Class TransformStringByte

java.lang.Object
org.synchronoss.cpo.core.transform.TransformStringByte
All Implemented Interfaces:
CpoTransform<byte[],String>

public class TransformStringByte extends Object implements CpoTransform<byte[],String>
Converts a String to a byte[]
Author:
david berry
  • Constructor Details

    • TransformStringByte

      public TransformStringByte()
      Creates an instance.
  • Method Details

    • transformIn

      public String transformIn(byte[] bytes) throws CpoException
      Converts a raw datastore value into the bean-side representation.
      Specified by:
      transformIn in interface CpoTransform<byte[],String>
      Parameters:
      bytes - the raw value read from the datastore
      Returns:
      the value to set on the bean attribute
      Throws:
      CpoException - if the value cannot be converted
    • transformOut

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