java.lang.Object
com.sap.cloud.sdk.datamodel.odata.helper.VdmObject<EntityT>
com.sap.cloud.sdk.datamodel.odata.helper.VdmEntity<Segment>
com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.segment.Segment

public class Segment extends VdmEntity<Segment>
Segment

Original entity name from the Odata EDM: A_SegmentType

  • Field Details

    • ALL_FIELDS

      public static final SegmentSelectable ALL_FIELDS
      Selector for all available fields of Segment.
    • SEGMENT

      public static final SegmentField<String> SEGMENT
      Use with available fluent helpers to apply the Segment field to query operations.
    • TO_TEXT

      public static final SegmentLink<SegmentText> TO_TEXT
      Use with available fluent helpers to apply the to_Text navigation property to query operations.
  • Constructor Details

    • Segment

      public Segment()
    • Segment

      public Segment(@Nullable String segment, List<SegmentText> toText)
  • Method Details

    • getType

      @Nonnull public Class<Segment> getType()
      Specified by:
      getType in class VdmObject<Segment>
    • setSegment

      public void setSegment(@Nullable String segment)
      (Key Field) Constraints: Not nullable, Maximum length: 10

      Original property name from the Odata EDM: Segment

      Parameters:
      segment - Segment for Segmental Reporting
    • getEntityCollection

      protected String getEntityCollection()
      Specified by:
      getEntityCollection in class VdmEntity<Segment>
    • getKey

      @Nonnull protected Map<String,Object> getKey()
      Overrides:
      getKey in class VdmObject<Segment>
    • toMapOfFields

      @Nonnull protected Map<String,Object> toMapOfFields()
      Overrides:
      toMapOfFields in class VdmObject<Segment>
    • fromMap

      protected void fromMap(Map<String,Object> inputValues)
      Overrides:
      fromMap in class VdmObject<Segment>
    • field

      @Nonnull public static <T> SegmentField<T> field(@Nonnull String fieldName, @Nonnull Class<T> fieldType)
      Use with available fluent helpers to apply an extension field to query operations.
      Type Parameters:
      T - The type of the extension field when performing value comparisons.
      Parameters:
      fieldName - The name of the extension field as returned by the OData service.
      fieldType - The Java type to use for the extension field when performing value comparisons.
      Returns:
      A representation of an extension field from this entity.
    • field

      @Nonnull public static <T, DomainT> SegmentField<T> field(@Nonnull String fieldName, @Nonnull TypeConverter<T,DomainT> typeConverter)
      Use with available fluent helpers to apply an extension field to query operations.
      Type Parameters:
      T - The type of the extension field when performing value comparisons.
      DomainT - The type of the extension field as returned by the OData service.
      Parameters:
      typeConverter - A TypeConverter<T, DomainT> instance whose first generic type matches the Java type of the field
      fieldName - The name of the extension field as returned by the OData service.
      Returns:
      A representation of an extension field from this entity, holding a reference to the given TypeConverter.
    • getDestinationForFetch

      @Nullable public HttpDestinationProperties getDestinationForFetch()
      Overrides:
      getDestinationForFetch in class VdmEntity<Segment>
    • setServicePathForFetch

      protected void setServicePathForFetch(@Nullable String servicePathForFetch)
      Overrides:
      setServicePathForFetch in class VdmEntity<Segment>
    • attachToService

      public void attachToService(@Nullable String servicePath, @Nonnull HttpDestinationProperties destination)
      Overrides:
      attachToService in class VdmEntity<Segment>
    • getDefaultServicePath

      protected String getDefaultServicePath()
      Overrides:
      getDefaultServicePath in class VdmEntity<Segment>
    • toMapOfNavigationProperties

      @Nonnull protected Map<String,Object> toMapOfNavigationProperties()
      Overrides:
      toMapOfNavigationProperties in class VdmObject<Segment>
    • fetchText

      @Nonnull public List<SegmentText> fetchText()
      Fetches the SegmentText entities (one to many) associated with this entity. This corresponds to the OData navigation property to_Text.

      Please note: This method will not cache or persist the query results.

      Returns:
      List containing one or more associated SegmentText entities. If no entities are associated then an empty list is returned.
      Throws:
      com.sap.cloud.sdk.datamodel.odata.client.exception.ODataException - If the entity is unmanaged, i.e. it has not been retrieved using the OData VDM's services and therefore has no ERP configuration context assigned. An entity is managed if it has been either retrieved using the VDM's services or returned from the VDM's services as the result of a CREATE or UPDATE call.
    • getTextOrFetch

      @Nonnull public List<SegmentText> getTextOrFetch()
      Retrieval of associated SegmentText entities (one to many). This corresponds to the OData navigation property to_Text.

      If the navigation property to_Text of a queried Segment is operated lazily, an ODataException can be thrown in case of an OData query error.

      Please note: Lazy loading of OData entity associations is the process of asynchronous retrieval and persisting of items from a navigation property. If a lazy property is requested by the application for the first time and it has not yet been loaded, an OData query will be run in order to load the missing information and its result will get cached for future invocations.

      Returns:
      List of associated SegmentText entities.
      Throws:
      com.sap.cloud.sdk.datamodel.odata.client.exception.ODataException - If the entity is unmanaged, i.e. it has not been retrieved using the OData VDM's services and therefore has no ERP configuration context assigned. An entity is managed if it has been either retrieved using the VDM's services or returned from the VDM's services as the result of a CREATE or UPDATE call.
    • getTextIfPresent

      @Nonnull public io.vavr.control.Option<List<SegmentText>> getTextIfPresent()
      Retrieval of associated SegmentText entities (one to many). This corresponds to the OData navigation property to_Text.

      If the navigation property for an entity Segment has not been resolved yet, this method will not query further information. Instead its Option result state will be empty.

      Returns:
      If the information for navigation property to_Text is already loaded, the result will contain the SegmentText entities. If not, an Option with result state empty is returned.
    • setText

      public void setText(@Nonnull List<SegmentText> value)
      Overwrites the list of associated SegmentText entities for the loaded navigation property to_Text.

      If the navigation property to_Text of a queried Segment is operated lazily, an ODataException can be thrown in case of an OData query error.

      Please note: Lazy loading of OData entity associations is the process of asynchronous retrieval and persisting of items from a navigation property. If a lazy property is requested by the application for the first time and it has not yet been loaded, an OData query will be run in order to load the missing information and its result will get cached for future invocations.

      Parameters:
      value - List of SegmentText entities.
    • addText

      public void addText(SegmentText... entity)
      Adds elements to the list of associated SegmentText entities. This corresponds to the OData navigation property to_Text.

      If the navigation property to_Text of a queried Segment is operated lazily, an ODataException can be thrown in case of an OData query error.

      Please note: Lazy loading of OData entity associations is the process of asynchronous retrieval and persisting of items from a navigation property. If a lazy property is requested by the application for the first time and it has not yet been loaded, an OData query will be run in order to load the missing information and its result will get cached for future invocations.

      Parameters:
      entity - Array of SegmentText entities.
    • builder

      @Nonnull public static Segment.SegmentBuilder builder()
    • getSegment

      @Nullable public String getSegment()
      (Key Field) Constraints: Not nullable, Maximum length: 10

      Original property name from the Odata EDM: Segment

      Returns:
      Segment for Segmental Reporting
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class VdmObject<Segment>
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class VdmEntity<Segment>
    • canEqual

      protected boolean canEqual(@Nullable Object other)
      Overrides:
      canEqual in class VdmEntity<Segment>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class VdmEntity<Segment>