Package org.opentcs.access.to.model
Class PathCreationTO
java.lang.Object
org.opentcs.access.to.CreationTO
org.opentcs.access.to.model.PathCreationTO
- All Implemented Interfaces:
java.io.Serializable
public class PathCreationTO extends CreationTO implements java.io.Serializable
A transfer object describing a path in the plant model.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PathCreationTO.Layout
Contains information regarding the grahical representation of a path. -
Constructor Summary
Constructors Constructor Description PathCreationTO(java.lang.String name, java.lang.String srcPointName, java.lang.String destPointName)
Creates a new instance. -
Method Summary
Modifier and Type Method Description java.lang.String
getDestPointName()
Returns the point name this path ends in.PathCreationTO.Layout
getLayout()
Returns the information regarding the grahical representation of this path.long
getLength()
Returns the length of this path (in mm).int
getMaxReverseVelocity()
Returns the maximum allowed reverse velocity (in mm/s) for this path.int
getMaxVelocity()
Returns the maximum allowed forward velocity (in mm/s) for this path.java.util.List<PeripheralOperationCreationTO>
getPeripheralOperations()
Returns the peripheral operations to be performed when a vehicle travels along this path.java.lang.String
getSrcPointName()
Returns the point name this path originates in.java.util.Map<java.lang.String,Envelope>
getVehicleEnvelopes()
Returns a map of envelope keys to envelopes that vehicles traversing this path may occupy.boolean
isLocked()
Returns the lock status of this path (i.e.java.lang.String
toString()
PathCreationTO
withDestPointName(java.lang.String destPointName)
Creates a copy of this object with the given destination point.PathCreationTO
withLayout(PathCreationTO.Layout layout)
Creates a copy of this object, with the given layout.PathCreationTO
withLength(long length)
Creates a copy of this object with the given path length (in mm).PathCreationTO
withLocked(boolean locked)
Creates a copy of this object that is locked iflocked==true
and unlocked otherwise.PathCreationTO
withMaxReverseVelocity(int maxReverseVelocity)
Creates a copy of this object with the allowed maximum reverse velocity (in mm/s).PathCreationTO
withMaxVelocity(int maxVelocity)
Creates a copy of this object with the maximum allowed forward velocity (in mm/s) for this path.PathCreationTO
withName(java.lang.String name)
Creates a copy of this object with the given name.PathCreationTO
withPeripheralOperations(java.util.List<PeripheralOperationCreationTO> peripheralOperations)
Creates a copy of this object with the given peripheral operations.PathCreationTO
withProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Creates a copy of this object with the given properties.PathCreationTO
withProperty(java.lang.String key, java.lang.String value)
Creates a copy of this object and adds the given property.PathCreationTO
withSrcPointName(java.lang.String srcPointName)
Creates a copy of this object with the given point name this path originates in.PathCreationTO
withVehicleEnvelopes(java.util.Map<java.lang.String,Envelope> vehicleEnvelopes)
Creates a copy of this object, with the given vehicle envelopes.Methods inherited from class org.opentcs.access.to.CreationTO
getModifiableProperties, getName, getProperties, listWithAppendix, mapWithMapping, propertiesWith
-
Constructor Details
-
PathCreationTO
public PathCreationTO(@Nonnull java.lang.String name, @Nonnull java.lang.String srcPointName, @Nonnull java.lang.String destPointName)Creates a new instance.- Parameters:
name
- The name of this path.srcPointName
- The point name this path originates in.destPointName
- The point name this path ends in.
-
-
Method Details
-
withName
Creates a copy of this object with the given name.- Overrides:
withName
in classCreationTO
- Parameters:
name
- The new name.- Returns:
- A copy of this object, differing in the given name.
-
getSrcPointName
@Nonnull public java.lang.String getSrcPointName()Returns the point name this path originates in.- Returns:
- The point name this path originates in.
-
withSrcPointName
Creates a copy of this object with the given point name this path originates in.- Parameters:
srcPointName
- The new source point name.- Returns:
- A copy of this object, differing in the given source point.
-
getDestPointName
@Nonnull public java.lang.String getDestPointName()Returns the point name this path ends in.- Returns:
- The point name this path ends in.
-
withDestPointName
Creates a copy of this object with the given destination point.- Parameters:
destPointName
- The new source point.- Returns:
- A copy of this object, differing in the given value.
-
getLength
public long getLength()Returns the length of this path (in mm).- Returns:
- The length of this path (in mm).
-
withLength
Creates a copy of this object with the given path length (in mm).- Parameters:
length
- the new length (in mm). Must be a positive value.- Returns:
- A copy of this object, differing in the given length.
-
getMaxVelocity
public int getMaxVelocity()Returns the maximum allowed forward velocity (in mm/s) for this path.- Returns:
- The maximum allowed forward velocity (in mm/s). A value of 0 means forward movement is not allowed on this path.
-
withMaxVelocity
Creates a copy of this object with the maximum allowed forward velocity (in mm/s) for this path.- Parameters:
maxVelocity
- The new maximum allowed velocity (in mm/s). May not be a negative value.- Returns:
- A copy of this object, differing in the given maximum velocity.
-
getMaxReverseVelocity
public int getMaxReverseVelocity()Returns the maximum allowed reverse velocity (in mm/s) for this path.- Returns:
- The maximum allowed reverse velocity (in mm/s). A value of 0 means reverse movement is not allowed on this path.
-
withMaxReverseVelocity
Creates a copy of this object with the allowed maximum reverse velocity (in mm/s).- Parameters:
maxReverseVelocity
- The new maximum allowed reverse velocity (in mm/s). Must not be a negative value.- Returns:
- A copy of this object, differing in the given maximum reverse velocity.
-
getPeripheralOperations
Returns the peripheral operations to be performed when a vehicle travels along this path.- Returns:
- The peripheral operations to be performed when a vehicle travels along this path.
-
withPeripheralOperations
public PathCreationTO withPeripheralOperations(@Nonnull java.util.List<PeripheralOperationCreationTO> peripheralOperations)Creates a copy of this object with the given peripheral operations.- Parameters:
peripheralOperations
- The peripheral operations.- Returns:
- A copy of this object, differing in the given peripheral operations.
-
isLocked
public boolean isLocked()Returns the lock status of this path (i.e. whether this path my be used by vehicles or not).- Returns:
true
if this path is currently locked (i.e. it may not be used by vehicles), elsefalse
.
-
withLocked
Creates a copy of this object that is locked iflocked==true
and unlocked otherwise.- Parameters:
locked
- Iftrue
, this path will be locked when the method call returns; iffalse
, this path will be unlocked.- Returns:
- a copy of this object, differing in the locked attribute.
-
withProperties
public PathCreationTO withProperties(@Nonnull java.util.Map<java.lang.String,java.lang.String> properties)Creates a copy of this object with the given properties.- Overrides:
withProperties
in classCreationTO
- Parameters:
properties
- The new properties.- Returns:
- A copy of this object, differing in the given properties.
-
withProperty
Creates a copy of this object and adds the given property. If value == null, then the key-value pair is removed from the properties.- Overrides:
withProperty
in classCreationTO
- Parameters:
key
- the key.value
- the value- Returns:
- A copy of this object that either includes the given entry in it's current properties, if value != null or excludes the entry otherwise.
-
getVehicleEnvelopes
Returns a map of envelope keys to envelopes that vehicles traversing this path may occupy.- Returns:
- A map of envelope keys to envelopes that vehicles traversing this path may occupy.
-
withVehicleEnvelopes
public PathCreationTO withVehicleEnvelopes(@Nonnull java.util.Map<java.lang.String,Envelope> vehicleEnvelopes)Creates a copy of this object, with the given vehicle envelopes.- Parameters:
vehicleEnvelopes
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getLayout
Returns the information regarding the grahical representation of this path.- Returns:
- The information regarding the grahical representation of this path.
-
withLayout
Creates a copy of this object, with the given layout.- Parameters:
layout
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-