Class JCoHelper.RecordWrapper

java.lang.Object
de.hybris.platform.sap.core.bol.backend.jco.JCoHelper.RecordWrapper
Enclosing class:
JCoHelper

public static final class JCoHelper.RecordWrapper extends Object
Wraps around a JCo record and decorates the record with convenient methods to set the record's data.
An important feature is that changelists (the X-structures) are maintained transparently and that you are able to directly pass the higher level internet sales data structures to the JCo struct.
Secondly the handling of boolean values is improved (no more "X").
Version:
1.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    RecordWrapper(com.sap.conn.jco.JCoRecord record)
    Creates a new wrapper around the JCo structure.
    RecordWrapper(com.sap.conn.jco.JCoRecord record, com.sap.conn.jco.JCoRecord changeList)
    Creates a new wrapper around the JCo record.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the specified field as a Java language boolean primitive type.
    com.sap.conn.jco.JCoRecord
    Returns the JCO.Record that is wrapped by this class and is used as a X-Structure.
    com.sap.conn.jco.JCoRecord
    Returns the JCO.Record that is wrapped by this class.
    Returns the value of the specified field as a Java language String object.
    Returns the value of the specified field as a TechKey object.
    void
    setValue(boolean value, String field)
    Sets the given field of the JCo structure to the provided value.
    void
    setValue(boolean value, String field, boolean maintainChange)
    Sets the given field of the JCo structure to the provided value.
    void
    setValue(double value, String field)
    Sets the given field of the JCo structure to the provided value.
    void
    setValue(double value, String field, boolean maintainChange)
    Sets the given field of the JCo structure to the provided value.
    void
    setValue(int value, String field)
    Sets the given field of the JCo structure to the provided value.
    void
    setValue(int value, String field, boolean maintainChange)
    Sets the given field of the JCo structure to the provided value.
    void
    setValue(TechKey techkey, String field)
    Sets the given field of the JCo structure to the value of the provided technical key (the TechKey is an abstraction of the SAP GUI).
    void
    setValue(TechKey techkey, String field, boolean maintainChange)
    Sets the given field of the JCo record to the value of the provided technical key (the TechKey is an abstraction of the SAP GUI).
    void
    setValue(String value, String field)
    Sets the given field of the JCo structure to the provided value.
    void
    setValue(String value, String field, boolean maintainChange)
    Sets the given field of the JCo structure to the provided value.
    void
    setValueFilledLeft(String value, String field, String filler)
    Sets the given field of the JCo structure to the provided value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RecordWrapper

      public RecordWrapper(com.sap.conn.jco.JCoRecord record, com.sap.conn.jco.JCoRecord changeList)
      Creates a new wrapper around the JCo record.
      Parameters:
      record - The record to store the data in
      changeList - Changelist used by the X-structures
    • RecordWrapper

      public RecordWrapper(com.sap.conn.jco.JCoRecord record)
      Creates a new wrapper around the JCo structure.
      Parameters:
      record - The record to store the data in
  • Method Details

    • getRecord

      public com.sap.conn.jco.JCoRecord getRecord()
      Returns the JCO.Record that is wrapped by this class.
      Returns:
      the wrapped JCoRecord
    • getChangeList

      public com.sap.conn.jco.JCoRecord getChangeList()
      Returns the JCO.Record that is wrapped by this class and is used as a X-Structure.
      Returns:
      the wrapped JCoRecord
    • setValue

      public void setValue(String value, String field)
      Sets the given field of the JCo structure to the provided value. The changelist, if present, is automatically maintained.
      Parameters:
      value - Value to be set
      field - JCo field to be filled with the value
    • setValueFilledLeft

      public void setValueFilledLeft(String value, String field, String filler)
      Sets the given field of the JCo structure to the provided value. The value is filled up with filler to the left The changelist, if present, is automatically maintained.
      Parameters:
      value - Value to be set
      field - JCo field to be filled with the value
      filler - The single-char-string to fill up value to the left
    • setValue

      public void setValue(String value, String field, boolean maintainChange)
      Sets the given field of the JCo structure to the provided value. The changelist, if present, is only maintained if the maintainChange flag is set to true.
      Parameters:
      value - Value to be set
      field - JCo field to be filled with the value
      maintainChange - Indicates whether the changelist should be maintained or not
    • setValue

      public void setValue(int value, String field)
      Sets the given field of the JCo structure to the provided value. The changelist, if present, is automatically maintained.
      Parameters:
      value - Value to be set
      field - JCo field to be filled with the value
    • setValue

      public void setValue(double value, String field)
      Sets the given field of the JCo structure to the provided value. The changelist, if present, is automatically maintained.
      Parameters:
      value - Value to be set
      field - JCo field to be filled with the value
    • setValue

      public void setValue(int value, String field, boolean maintainChange)
      Sets the given field of the JCo structure to the provided value. The changelist, if present, is only maintained if the maintainChange flag is set to true.
      Parameters:
      value - Value to be set
      field - JCo field to be filled with the value
      maintainChange - Indicates whether the changelist should be maintained or not
    • setValue

      public void setValue(double value, String field, boolean maintainChange)
      Sets the given field of the JCo structure to the provided value. The changelist, if present, is only maintained if the maintainChange flag is set to true.
      Parameters:
      value - Value to be set
      field - JCo field to be filled with the value
      maintainChange - Indicates whether the changelist should be maintained or not
    • setValue

      public void setValue(boolean value, String field)
      Sets the given field of the JCo structure to the provided value. The changelist, if present, is automatically maintained.
      Parameters:
      value - Value to be set
      field - JCo field to be filled with the value
    • setValue

      public void setValue(boolean value, String field, boolean maintainChange)
      Sets the given field of the JCo structure to the provided value. The changelist, if present, is only maintained if the maintainChange flag is set to true.
      Parameters:
      value - Value to be set
      field - JCo field to be filled with the value
      maintainChange - Indicates whether the changelist should be maintained or not
    • setValue

      public void setValue(TechKey techkey, String field)
      Sets the given field of the JCo structure to the value of the provided technical key (the TechKey is an abstraction of the SAP GUI).
      The changelist, if present, is automatically maintained.
      If the provided key is null nothing is done and the method returns immediately.
      Parameters:
      techkey - Technical key to be set
      field - JCo field to be filled with the value
    • setValue

      public void setValue(TechKey techkey, String field, boolean maintainChange)
      Sets the given field of the JCo record to the value of the provided technical key (the TechKey is an abstraction of the SAP GUI).
      The changelist, if present, is only maintained if the maintainChange flag is set to true.
      If the provided tech key is null nothing is done and the method returns immediately.
      Parameters:
      techkey - Technical key to be set
      field - JCo field to be filled with the value
      maintainChange - Indicates whether the changelist should be maintained or not
    • getTechKey

      public TechKey getTechKey(String field)
      Returns the value of the specified field as a TechKey object.
      Parameters:
      field - JCo field to be retrieved
      Returns:
      TechKey constructed from the value of the given field
    • getString

      public String getString(String field)
      Returns the value of the specified field as a Java language String object.
      Parameters:
      field - JCo field to be retrieved
      Returns:
      String constructed from the value of the given field
    • getBoolean

      public boolean getBoolean(String field)
      Returns the value of the specified field as a Java language boolean primitive type.
      Parameters:
      field - JCo field to be retrieved
      Returns:
      Boolean constructed from the value of the given field