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 java.lang.ObjectWraps 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetBoolean(java.lang.String field)Returns the value of the specified field as a Java languagebooleanprimitive type.com.sap.conn.jco.JCoRecordgetChangeList()Returns the JCO.Record that is wrapped by this class and is used as a X-Structure.com.sap.conn.jco.JCoRecordgetRecord()Returns the JCO.Record that is wrapped by this class.java.lang.StringgetString(java.lang.String field)Returns the value of the specified field as a Java languageStringobject.TechKeygetTechKey(java.lang.String field)Returns the value of the specified field as aTechKeyobject.voidsetValue(boolean value, java.lang.String field)Sets the given field of the JCo structure to the provided value.voidsetValue(boolean value, java.lang.String field, boolean maintainChange)Sets the given field of the JCo structure to the provided value.voidsetValue(double value, java.lang.String field)Sets the given field of the JCo structure to the provided value.voidsetValue(double value, java.lang.String field, boolean maintainChange)Sets the given field of the JCo structure to the provided value.voidsetValue(int value, java.lang.String field)Sets the given field of the JCo structure to the provided value.voidsetValue(int value, java.lang.String field, boolean maintainChange)Sets the given field of the JCo structure to the provided value.voidsetValue(TechKey techkey, java.lang.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).voidsetValue(TechKey techkey, java.lang.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).voidsetValue(java.lang.String value, java.lang.String field)Sets the given field of the JCo structure to the provided value.voidsetValue(java.lang.String value, java.lang.String field, boolean maintainChange)Sets the given field of the JCo structure to the provided value.voidsetValueFilledLeft(java.lang.String value, java.lang.String field, java.lang.String filler)Sets the given field of the JCo structure to the provided value.
-
-
-
Constructor Detail
-
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 inchangeList- 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 Detail
-
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(java.lang.String value, java.lang.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 setfield- JCo field to be filled with the value
-
setValueFilledLeft
public void setValueFilledLeft(java.lang.String value, java.lang.String field, java.lang.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 setfield- JCo field to be filled with the valuefiller- The single-char-string to fill up value to the left
-
setValue
public void setValue(java.lang.String value, java.lang.String field, boolean maintainChange)Sets the given field of the JCo structure to the provided value. The changelist, if present, is only maintained if themaintainChangeflag is set totrue.- Parameters:
value- Value to be setfield- JCo field to be filled with the valuemaintainChange- Indicates whether the changelist should be maintained or not
-
setValue
public void setValue(int value, java.lang.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 setfield- JCo field to be filled with the value
-
setValue
public void setValue(double value, java.lang.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 setfield- JCo field to be filled with the value
-
setValue
public void setValue(int value, java.lang.String field, boolean maintainChange)Sets the given field of the JCo structure to the provided value. The changelist, if present, is only maintained if themaintainChangeflag is set totrue.- Parameters:
value- Value to be setfield- JCo field to be filled with the valuemaintainChange- Indicates whether the changelist should be maintained or not
-
setValue
public void setValue(double value, java.lang.String field, boolean maintainChange)Sets the given field of the JCo structure to the provided value. The changelist, if present, is only maintained if themaintainChangeflag is set totrue.- Parameters:
value- Value to be setfield- JCo field to be filled with the valuemaintainChange- Indicates whether the changelist should be maintained or not
-
setValue
public void setValue(boolean value, java.lang.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 setfield- JCo field to be filled with the value
-
setValue
public void setValue(boolean value, java.lang.String field, boolean maintainChange)Sets the given field of the JCo structure to the provided value. The changelist, if present, is only maintained if themaintainChangeflag is set totrue.- Parameters:
value- Value to be setfield- JCo field to be filled with the valuemaintainChange- Indicates whether the changelist should be maintained or not
-
setValue
public void setValue(TechKey techkey, java.lang.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 isnullnothing is done and the method returns immediately.- Parameters:
techkey- Technical key to be setfield- JCo field to be filled with the value
-
setValue
public void setValue(TechKey techkey, java.lang.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 themaintainChangeflag is set totrue.
If the provided tech key isnullnothing is done and the method returns immediately.- Parameters:
techkey- Technical key to be setfield- JCo field to be filled with the valuemaintainChange- Indicates whether the changelist should be maintained or not
-
getTechKey
public TechKey getTechKey(java.lang.String field)
Returns the value of the specified field as aTechKeyobject.- Parameters:
field- JCo field to be retrieved- Returns:
- TechKey constructed from the value of the given field
-
getString
public java.lang.String getString(java.lang.String field)
Returns the value of the specified field as a Java languageStringobject.- Parameters:
field- JCo field to be retrieved- Returns:
- String constructed from the value of the given field
-
getBoolean
public boolean getBoolean(java.lang.String field)
Returns the value of the specified field as a Java languagebooleanprimitive type.- Parameters:
field- JCo field to be retrieved- Returns:
- Boolean constructed from the value of the given field
-
-