Interface Identifiable<I extends Identifiable<I>>

    • Method Detail

      • getNetwork

        Network getNetwork()
        Get the network associated to the object.
      • getId

        String getId()
        Get the unique identifier of the object.
      • getAliases

        default Set<String> getAliases()
        Get the aliases of the object.
      • getAliasFromType

        default Optional<String> getAliasFromType​(String aliasType)
        Get the alias of the object with a given alias type if it exists. Else return an empty optional.
      • getAliasType

        default Optional<String> getAliasType​(String alias)
        Get the alias type of an alias if it exists, an empty optional otherwise. If the alias does not exist, return an empty optional.
      • addAlias

        default void addAlias​(String alias)
        Add an alias to the object. Aliases must be unique in associated Network, and different from any identifiable ID. No alias type is associated to this alias. If the alias already exists (i.e. is not unique) or equals an identifiable ID, throw a PowsyblException
      • addAlias

        default void addAlias​(String alias,
                              boolean ensureAliasUnicity)
      • addAlias

        default void addAlias​(String alias,
                              String aliasType)
        Add an alias to the object. Aliases must be unique in associated Network, and different from any identifiable ID. This alias is associated to a given alias type. If the given alias type is null or empty, no alias type is considered associated to the alias. Only one alias can be associated to a non null given alias type for one object. If the alias already exists (i.e. is not unique) or equals an identifiable ID, throw a PowsyblException If a given non null type already has an associated alias for this object, throw a PowsyblException
      • addAlias

        default void addAlias​(String alias,
                              String aliasType,
                              boolean ensureAliasUnicity)
      • removeAlias

        default void removeAlias​(String alias)
        Remove an alias of the object. If the alias does not exist for this object, throw a PowsyblException
      • hasAliases

        default boolean hasAliases()
        Return true if identifiable has aliases.
      • getOptionalName

        default Optional<String> getOptionalName()
        Return an optional containing the name of the object if it exists. If not, return an empty optional.
      • getNameOrId

        default String getNameOrId()
        Get the name of the object if it exists. If not, get the unique identifier of the object.
      • setName

        default I setName​(String name)
        Update object name.
        Parameters:
        name - new name of the object (could be null to erase the name)
        Returns:
        the object itself
      • hasProperty

        boolean hasProperty()
        Check that this object has some properties.
      • hasProperty

        boolean hasProperty​(String key)
        Check that this object has property with specified name.
      • getProperty

        String getProperty​(String key)
        Get property associated to specified key.
      • getProperty

        String getProperty​(String key,
                           String defaultValue)
        Get property associated to specified key, with default value.
      • setProperty

        String setProperty​(String key,
                           String value)
        Set property value associated to specified key.
      • removeProperty

        boolean removeProperty​(String key)
        Remove property with specified key.
        Parameters:
        key - the property key
        Returns:
        true if property exists and has been removed, false otherwise
      • getPropertyNames

        Set<String> getPropertyNames()
        Get properties key values.
      • isFictitious

        default boolean isFictitious()
        Get the fictitious status
      • setFictitious

        default void setFictitious​(boolean fictitious)
        Set the fictitious status
      • getType

        IdentifiableType getType()
        Get identifiable type.
        Returns:
        the identifiable type