Klasse TCSObject<E extends TCSObject<E>>

java.lang.Object
org.opentcs.data.TCSObject<E>
Typparameter:
E - The actual object class.
Alle implementierten Schnittstellen:
Serializable
Bekannte direkte Unterklassen:
LocationType, OrderSequence, PeripheralJob, TCSResource, TransportOrder, Vehicle, VisualLayout

public abstract class TCSObject<E extends TCSObject<E>> extends Object implements Serializable
Describes the base behaviour of TCS data objects.
Siehe auch:
  • Felddetails

  • Konstruktordetails

    • TCSObject

      protected TCSObject(@Nonnull String objectName)
      Creates a new TCSObject.
      Parameter:
      objectName - The new object's name.
    • TCSObject

      protected TCSObject(@Nonnull String objectName, @Nonnull Map<String,String> properties, @Nonnull ObjectHistory history)
      Creates a new TCSObject.
      Parameter:
      objectName - The new object's name.
      properties - A set of properties (key-value pairs) associated with this object.
      history - A history of events related to this object.
  • Methodendetails

    • getName

      @Nonnull public String getName()
      Returns this object's name.
      Gibt zurück:
      This object's name.
    • getReference

      public TCSObjectReference<E> getReference()
      Returns a transient/soft reference to this object.
      Gibt zurück:
      A transient/soft reference to this object.
    • getProperties

      @Nonnull public Map<String,String> getProperties()
      Returns an unmodifiable view on this object's properties.
      Gibt zurück:
      This object's properties.
    • getProperty

      @Nullable public String getProperty(String key)
      Returns the property value for the given key. This is basically a shortcut for getProperties().get(key).
      Parameter:
      key - The property's key.
      Gibt zurück:
      The property value for the given key, or null, if there is none.
    • withProperty

      public abstract TCSObject<E> withProperty(String key, String value)
      Creates a copy of this object, with the given property integrated.
      Parameter:
      key - The key of the property to be changed.
      value - The new value of the property, or null, if the property is to be removed.
      Gibt zurück:
      A copy of this object, with the given property integrated.
    • withProperties

      public abstract TCSObject<E> withProperties(Map<String,String> properties)
      Creates a copy of this object, with the given properties.
      Parameter:
      properties - The properties.
      Gibt zurück:
      A copy of this object, with the given properties.
    • getHistory

      public ObjectHistory getHistory()
    • withHistoryEntry

      public abstract TCSObject<E> withHistoryEntry(ObjectHistory.Entry entry)
      Creates a copy of this object, with the given history entry integrated.
      Parameter:
      entry - The history entry to be integrated.
      Gibt zurück:
      A copy of this object, with the given history entry integrated.
    • withHistory

      public abstract TCSObject<E> withHistory(ObjectHistory history)
      Creates a copy of this object, with the given history.
      Parameter:
      history - The history.
      Gibt zurück:
      A copy of this object, with the given history.
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • equals

      public boolean equals(Object obj)
      Checks if this object is equal to another one. Two TCSObjects are equal if both their names and their runtime classes are equal.
      Setzt außer Kraft:
      equals in Klasse Object
      Parameter:
      obj - The object to compare this one to.
      Gibt zurück:
      true if, and only if, obj is also a TCSObject and both its name and runtime class equal those of this object.
    • hashCode

      public int hashCode()
      Returns this object's hashcode. A TCSObject's hashcode is calculated by XORing its ID's hashcode and the hashcode of its runtime class's name.
      Setzt außer Kraft:
      hashCode in Klasse Object
      Gibt zurück:
      This object's hashcode.
    • propertiesWith

      protected final Map<String,String> propertiesWith(String key, String value)
      Returns a new map of this object's properties, with the given property integrated.
      Parameter:
      key - The key of the property to be changed.
      value - The new value of the property, or null, if the property is to be removed.
      Gibt zurück:
      A new map of this object's properties, with the given property integrated.
    • mapWithoutNullValues

      protected static final <K, V> Map<K,V> mapWithoutNullValues(Map<K,V> original)
      Returns a new map with the entries from the given map but all entries with null values removed.
      Typparameter:
      K - The type of the map's keys.
      V - The type of the map's values.
      Parameter:
      original - The original map.
      Gibt zurück:
      A new map with the entries from the given map but all entries with null values removed.
    • listWithoutNullValues

      protected static final <V> List<V> listWithoutNullValues(List<V> original)
      Returns a new list with the values from the given list but all null values removed.
      Typparameter:
      V - The type of the list's values.
      Parameter:
      original - The original list.
      Gibt zurück:
      A new list with the values from the given list but all null values removed.
    • setWithoutNullValues

      protected static final <V> Set<V> setWithoutNullValues(Set<V> original)
      Returns a new set with the values from the given set but all null values removed.
      Typparameter:
      V - The type of the set's values.
      Parameter:
      original - The original set.
      Gibt zurück:
      A new set with the values from the given set but all null values removed.