Package org.opentcs.access.to.model

# Class LocationCreationTO

java.lang.Object
org.opentcs.access.to.CreationTO
org.opentcs.access.to.model.LocationCreationTO

All Implemented Interfaces:
  `java.io.Serializable`

    public class LocationCreationTO
    extends CreationTO
    implements java.io.Serializable

A transfer object describing a location in a plant model.

See Also:
  Serialized Form

- ## Nested Class Summary

  Nested Classes
  Modifier and Type | Class | Description
  --- | --- | ---
  `static class` | `LocationCreationTO.Layout` | Contains information regarding the grahical representation of a location.

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `LocationCreationTO​(java.lang.String name, java.lang.String typeName, Triple position)` | Creates a new instance

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `LocationCreationTO.Layout` | `getLayout()` | Returns the information regarding the grahical representation of this location.
  `java.util.Map<java.lang.String,​java.util.Set<java.lang.String>>` | `getLinks()` | Returns the links attaching points to this location.
  `Triple` | `getPosition()` | Returns the position of this location (in mm).
  `java.lang.String` | `getTypeName()` | Returns the name of this location's type.
  `boolean` | `isLocked()` | Returns the lock status of this location (i.e.
  `java.lang.String` | `toString()` |
  `LocationCreationTO` | `withLayout​(LocationCreationTO.Layout layout)` | Creates a copy of this object, with the given layout.
  `LocationCreationTO` | `withLink​(java.lang.String pointName, java.util.Set<java.lang.String> allowedOperations)` | Creates a copy of this object with the given links that attach points to this location.
  `LocationCreationTO` | `withLinks​(java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> links)` | Creates a copy of this object with the given links that attach points to this location.
  `LocationCreationTO` | `withLocked​(boolean locked)` | Creates a copy of this object with the given locked flag.
  `LocationCreationTO` | `withName​(java.lang.String name)` | Creates a copy of this object with the given name.
  `LocationCreationTO` | `withPosition​(Triple position)` | Creates a copy of this object with the given position (in mm).
  `LocationCreationTO` | `withProperties​(java.util.Map<java.lang.String,​java.lang.String> properties)` | Creates a copy of this object with the given properties.
  `LocationCreationTO` | `withProperty​(java.lang.String key, java.lang.String value)` | Creates a copy of this object and adds the given property.
  `LocationCreationTO` | `withTypeName​(java.lang.String typeName)` | Creates a copy of this object with the location's type.

  ### Methods inherited from class org.opentcs.access.to.CreationTO

  `getModifiableProperties, getName, getProperties, listWithAppendix, mapWithMapping, propertiesWith`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### LocationCreationTO

    public LocationCreationTO​(@Nonnull java.lang.String name, @Nonnull java.lang.String typeName, @Nonnull Triple position)
    Creates a new instance
    Parameters:
      `name` - The name of this location.
      `typeName` - The name of this location's type.
      `position` - The position of this location.

- ## Method Details

  - ### withName

    public LocationCreationTO withName​(@Nonnull java.lang.String name)
    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 name.

  - ### getTypeName

    @Nonnull public java.lang.String getTypeName()
    Returns the name of this location's type.
    Returns:
      The name of this location's type.

  - ### withTypeName

    public LocationCreationTO withTypeName​(@Nonnull java.lang.String typeName)
    Creates a copy of this object with the location's type.
    Parameters:
      `typeName` - The location type.
    Returns:
      A copy of this object, differing in the given type.

  - ### getPosition

    @Nonnull public Triple getPosition()
    Returns the position of this location (in mm).
    Returns:
      The position of this location (in mm).

  - ### withPosition

    public LocationCreationTO withPosition​(@Nonnull Triple position)
    Creates a copy of this object with the given position (in mm).
    Parameters:
      `position` - the new position of this location (in mm).
    Returns:
      A copy of this object, differing in the given position.

  - ### getLinks

    @Nonnull public java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> getLinks()
    Returns the links attaching points to this location. This is a map of point names to allowed operations.
    Returns:
      The links attaching points to this location.

  - ### withLinks

    public LocationCreationTO withLinks​(@Nonnull java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> links)
    Creates a copy of this object with the given links that attach points to this location.
    Parameters:
      `links` - the new links. This is supposed to be a map of point names to allowed operations.
    Returns:
      A copy of this object, differing in the given links.

  - ### withLink

    public LocationCreationTO withLink​(@Nonnull java.lang.String pointName, @Nonnull java.util.Set<java.lang.String> allowedOperations)
    Creates a copy of this object with the given links that attach points to this location.
    Parameters:
      `pointName` - The name of the point linked to.
      `allowedOperations` - The operations allowed at the point.
    Returns:
      A copy of this object, differing in the given link.

  - ### isLocked

    public boolean isLocked()
    Returns the lock status of this location (i.e. whether it my be used by vehicles or not).
    Returns:
      `true` if this location is currently locked (i.e. it may not be used by vehicles), else `false`.

  - ### withLocked

    public LocationCreationTO withLocked​(boolean locked)
    Creates a copy of this object with the given locked flag.
    Parameters:
      `locked` - The new locked attribute.
    Returns:
      A copy of this object, differing in the locked attribute.

  - ### withProperties

    public LocationCreationTO 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 class `CreationTO`
    Parameters:
      `properties` - The new properties.
    Returns:
      A copy of this object, differing in the given properties.

  - ### withProperty

    public LocationCreationTO withProperty​(@Nonnull java.lang.String key, @Nonnull java.lang.String value)
    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 class `CreationTO`
    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.

  - ### getLayout

    public LocationCreationTO.Layout getLayout()
    Returns the information regarding the grahical representation of this location.
    Returns:
      The information regarding the grahical representation of this location.

  - ### withLayout

    public LocationCreationTO withLayout​(LocationCreationTO.Layout layout)
    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 class `java.lang.Object`