Package org.opentcs.access.to
Class CreationTO
java.lang.Object
org.opentcs.access.to.CreationTO
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BlockCreationTO,DestinationCreationTO,LocationCreationTO,LocationTypeCreationTO,OrderSequenceCreationTO,PathCreationTO,PeripheralJobCreationTO,PeripheralOperationCreationTO,PlantModelCreationTO,PointCreationTO,TransportOrderCreationTO,VehicleCreationTO,VisualLayoutCreationTO
The base class for all creation transfer objects.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionCreationTO(String name) Creates a new instance.protectedCreationTO(String name, Map<String, String> properties) -
Method Summary
Modifier and TypeMethodDescriptionReturns the properties of this transfer object.getName()Returns the name of this transfer object.Returns the properties of this transfer object in an unmodifiable map.protected static final <T> List<T> listWithAppendix(List<T> list, T newElement) Returns a new list, with the elements of the given list and the given element added to it.protected static final <K,V> Map <K, V> mapWithMapping(Map<K, V> map, K key, V value) Returns a new map, with the mappings of the given map and the given mapping added to it.propertiesWith(String key, String value) Creates a copy of this object with the given name.withProperties(Map<String, String> properties) Creates a copy of this object with the given properties.withProperty(String key, String value) Creates a copy of this object with the given property.
-
Constructor Details
-
CreationTO
Creates a new instance.- Parameters:
name- The name of this transfer object.
-
CreationTO
-
-
Method Details
-
getName
Returns the name of this transfer object.- Returns:
- The name of this transfer object.
-
withName
Creates a copy of this object with the given name.- Parameters:
name- the new name- Returns:
- A copy of this object, differing in the given value.
-
getProperties
Returns the properties of this transfer object in an unmodifiable map.- Returns:
- The properties of this transfer object in an unmodifiable map.
-
getModifiableProperties
Returns the properties of this transfer object.- Returns:
- The properties of this transfer object.
-
withProperties
Creates a copy of this object with the given properties.- Parameters:
properties- The properties.- Returns:
- A copy of this object with the given properties.
-
withProperty
Creates a copy of this object with the given property. If value == null is true then the key-value pair is removed from the properties.- Parameters:
key- the key.value- the value- Returns:
- A copy of this object that includes the given property or removes the entry, if value == null.
-
propertiesWith
-
mapWithMapping
Returns a new map, with the mappings of the given map and the given mapping added to it.- Type Parameters:
K- The type of the map's keys.V- The type of the map's values.- Parameters:
map- The map to be extended.key- The key.value- The value. May benullto remove the mapping from the given map.- Returns:
- a new map, with the mappings of the given map and the given mapping added to it.
-
listWithAppendix
Returns a new list, with the elements of the given list and the given element added to it.- Type Parameters:
T- The element type of the list.- Parameters:
list- The list to be extended.newElement- The element to be added to the list.- Returns:
- A new list, consisting of the given list and the given element added to it.
-