Class PeripheralOperationCreationTO

java.lang.Object
org.opentcs.access.to.CreationTO
org.opentcs.access.to.peripherals.PeripheralOperationCreationTO
All Implemented Interfaces:
java.io.Serializable

public class PeripheralOperationCreationTO
extends CreationTO
implements java.io.Serializable
A transfer object describing an operation to be performed by a peripheral device.
See Also:
Serialized Form
  • Constructor Details

    • PeripheralOperationCreationTO

      public PeripheralOperationCreationTO​(@Nonnull java.lang.String operation, @Nonnull java.lang.String locationName)
      Creates a new instance with executionTrigger set to PeripheralOperation.ExecutionTrigger.BEFORE_MOVEMENT and completionRequired set to false.
      Parameters:
      operation - The operation to be performed by the peripheral device.
      locationName - The name of the location the peripheral device is associated with.
  • Method Details

    • withName

      public PeripheralOperationCreationTO withName​(@Nonnull java.lang.String name)
      Description copied from class: CreationTO
      Creates a copy of this object with the given name.
      Overrides:
      withName in class CreationTO
      Parameters:
      name - the new name
      Returns:
      A copy of this object, differing in the given value.
    • withProperties

      public PeripheralOperationCreationTO withProperties​(@Nonnull java.util.Map<java.lang.String,​java.lang.String> properties)
      Overrides:
      withProperties in class CreationTO
    • withProperty

      public PeripheralOperationCreationTO withProperty​(@Nonnull java.lang.String key, @Nonnull java.lang.String value)
      Description copied from class: CreationTO
      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.
      Overrides:
      withProperty in class CreationTO
      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.
    • getOperation

      @Nonnull public java.lang.String getOperation()
      Returns the operation to be performed by the peripheral device.
      Returns:
      The operation to be performed by the peripheral device.
    • withOperation

      public PeripheralOperationCreationTO withOperation​(@Nonnull java.lang.String operation)
      Creates a copy of this object, with the given operation.
      Parameters:
      operation - The value to be set in the copy.
      Returns:
      A copy of this object, differing in the given value.
    • getLocationName

      @Nonnull public java.lang.String getLocationName()
      Returns the name of the location the peripheral device is associated with.
      Returns:
      The name of the location the peripheral device is associated with.
    • withLocationName

      public PeripheralOperationCreationTO withLocationName​(@Nonnull java.lang.String locationName)
      Creates a copy of this object, with the given location name.
      Parameters:
      locationName - The value to be set in the copy.
      Returns:
      A copy of this object, differing in the given value.
    • getExecutionTrigger

      @Nonnull public PeripheralOperation.ExecutionTrigger getExecutionTrigger()
      Returns the moment at which this operation is to be performed.
      Returns:
      The moment at which this operation is to be performed.
    • withExecutionTrigger

      public PeripheralOperationCreationTO withExecutionTrigger​(@Nonnull PeripheralOperation.ExecutionTrigger executionTrigger)
      Creates a copy of this object, with the given execution trigger.
      Parameters:
      executionTrigger - The value to be set in the copy.
      Returns:
      A copy of this object, differing in the given value.
    • isCompletionRequired

      public boolean isCompletionRequired()
      Returns whether the completion of this operation is required to allow a vehicle to continue driving.
      Returns:
      Whether the completion of this operation is required to allow a vehicle to continue driving.
    • withCompletionRequired

      public PeripheralOperationCreationTO withCompletionRequired​(boolean completionRequired)
      Creates a copy of this object, with the given completion required flag.
      Parameters:
      completionRequired - The value to be set in the copy.
      Returns:
      A copy of this object, differing in the given value.