Class PathDescriptorPart

  • All Implemented Interfaces:
    Serializable

    @Immutable
    public final class PathDescriptorPart
    extends Object
    implements Serializable
    This class keeps a single path part. This can be either a static string or a variable argument with optional constraints.
    Author:
    Philip Helger
    See Also:
    Serialized Form
    • Method Detail

      • isVariable

        public boolean isVariable()
        Returns:
        true if this is variable path part, false if it is static
      • getName

        @Nonnull
        @Nonempty
        public String getName()
        Returns:
        Either the static string or the name of the variable. Neither null nor empty.
      • getAllVariableConstraints

        @Nonnull
        @ReturnsMutableCopy
        public com.helger.commons.collection.impl.ICommonsList<PathDescriptorVariableConstraint> getAllVariableConstraints()
        Returns:
        The optional variable constraints. Only relevant if this is a variable path part. Never null but maybe empty.
      • matches

        public boolean matches​(@Nonnull
                               String sPathPart)
        Check if the passed path part matches the requirements of this object. If this is a static path part, it's a simple string equals. For variable path parts, all the constraints (if any) must be fulfilled.
        Parameters:
        sPathPart - The string to be checked.
        Returns:
        true if the passed string matches, false otherwise.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object