Class IDocSegment

java.lang.Object
com.onenetwork.platform.integ.sap.IDocElement
com.onenetwork.platform.integ.sap.IDocSegment

public class IDocSegment
extends IDocElement
A segment within an IDoc.
  • Field Details

  • Constructor Details

  • Method Details

    • setIDocSegmentDef

      public void setIDocSegmentDef​(IDocSegmentDef segmentDef)
      Sets the IDocSegmentDef which describes the structure of this IDocSegment
      Parameters:
      iDocSegmentDef - IDocSegmentDef which describes the structure of this IDocSegment
    • getIDocSegmentDef

      public IDocSegmentDef getIDocSegmentDef()
      Returns:
      IDocSegmentDef which describes the structure of this IDocSegment
    • getFields

      public java.util.List<IDocField> getFields()
      Returns all the fields within the IDocSegment. Mutating this list will alter the IDocSegment.
      Returns:
      all the fields within the IDocSegment
    • getField

      public IDocField getField​(java.lang.String fieldName)
      Returns the first IDocField matching the given name
      Parameters:
      fieldName - name of the field to find
      Returns:
      first field matching the given name
    • getField

      public IDocField getField​(int position)
      Returns the field at the position specified
      Parameters:
      position - position at which to select the field
      Returns:
      field at the position specified
    • addField

      public IDocField addField​(java.lang.String fieldName, java.lang.Object value)
      Creates an IDocField with the name and value specified and adds the same to the list of fields within "this" segment.
      Parameters:
      fieldName -
      value - field value
      Returns:
      field that was created and/or updated
    • addField

      public IDocField addField​(IDocField idocField)
      Adds an IDocField to this Segment
      Parameters:
      idocField - field to add
      Returns:
      field added
    • addField

      public IDocField addField​(IDocField idocField, int position)
      Add an IDocField to "this" Segment at the specified position
      Parameters:
      idocField -
      position -
      Returns:
      field added
    • addField

      public IDocField addField​(java.lang.String fieldName, java.lang.Object value, IDocFieldDef idocFieldDef)
      Creates an IDocField and adds it to the specified position within "this" segment.Field Indexing is zero based and should start with zero
      Parameters:
      fieldName -
      value -
      idocFieldDef - - the idocFieldDef that defines the metadata for the field to be added
      Returns:
      field that was added
    • getChildSegments

      public java.util.List<IDocSegment> getChildSegments()
      Returns the child segments within this segment. Mutating this list will alter this IDocSegment.
      Returns:
      child segments within this segment
    • getChildSegments

      public java.util.List<IDocSegment> getChildSegments​(java.lang.String segmentName)
      Returns a new List containing the child segments matching the given name.
      Parameters:
      segmentName - segment name to search for
      Returns:
      child segments matching the given name, or an empty list
    • getFirstChildSegment

      public IDocSegment getFirstChildSegment​(java.lang.String segmentName)
      Returns the first occurrence of the child segment matching the given name.
      Parameters:
      name - of the segment
      Returns:
      first occurrence of the child segment matching the given name, or null
    • addChildSegment

      public IDocSegment addChildSegment​(java.lang.String segmentName)
      Creates a segment with given name, adds it to the IDocSegment and returns it.
      Parameters:
      segmentName - name for the new segment
      Returns:
      child IDocSegment that was created and added
    • addChildSegment

      public IDocSegment addChildSegment​(IDocSegment segment)
      Added a IDocSegment to the List of IDocSegments.
      Parameters:
      segment -
      Returns:
      child Segment that was added