Class TransformNoOp

java.lang.Object
org.synchronoss.cpo.cassandra.transform.TransformNoOp
All Implemented Interfaces:
CassandraCpoTransform<Integer,Integer>, CpoTransform<Integer,Integer>

public class TransformNoOp extends Object implements CassandraCpoTransform<Integer,Integer>
This is an example of a transform that does nothing. It is used to test the mechanics of the transform logic within CPO.
Author:
david berry
  • Constructor Details

    • TransformNoOp

      public TransformNoOp()
      Create a TransformNoOp
  • Method Details

    • transformIn

      public Integer transformIn(Integer dbIn) throws CpoException
      Transforms the datasource object into an object required by the class. The type of the dbIn parameter and the type of the return value must change to match the types being converted. Reflection is used to true everything up at runtime.

      e.g public byte[] transformIn(Blob dbIn) would be the signature for converting a Blob to a byte[] to be stored in the bean.

      Specified by:
      transformIn in interface CpoTransform<Integer,Integer>
      Parameters:
      dbIn - The value from the datasource that will be transformed into the format that is required by the bean.
      Returns:
      The object to be stored in the attribute
      Throws:
      CpoException - An error occurred
    • transformOut

      public Integer transformOut(CassandraBoundStatementFactory cbsf, Integer attrOut) throws CpoException
      Transforms the data from the class attribute to the object required by the datasource. The type of the attrOut parameter and the type of the return value must change to match the types being converted. Reflection is used to true everything up at runtime.

      e.g public ByteBuffer transformOut(CassandraBoundStatementFactory cbsf, byte[] attrOut) would be the signature for converting a byte[] stored in the bean into a ByteBuffer for the datasource.

      Specified by:
      transformOut in interface CassandraCpoTransform<Integer,Integer>
      Parameters:
      cbsf - a reference to the CassandraBoundStatementFactory. This is necessary for Transforms that need access to the bound statement/session to deal with certain datatypes.
      attrOut - The attribute object that needs to get transformed into the db representation
      Returns:
      The object to be stored in the datasource
      Throws:
      CpoException - An error occurred
    • transformOut

      public Integer transformOut(Integer j) throws CpoException, UnsupportedOperationException
      Description copied from interface: CpoTransform
      Converts a bean attribute's value into the raw datastore-side representation.
      Specified by:
      transformOut in interface CpoTransform<Integer,Integer>
      Parameters:
      j - the value read from the bean attribute
      Returns:
      the value to bind to the datastore
      Throws:
      CpoException - if the value cannot be converted
      UnsupportedOperationException