Class IdentifierConverter<A,​B>

  • Type Parameters:
    B - the type to and from which we are translating
    All Implemented Interfaces:
    com.google.common.base.Function<A,​B>, Function<A,​B>

    public abstract class IdentifierConverter<A,​B>
    extends com.google.common.base.Converter<A,​B>
    An IdentifierConverter accepts and returns identifiers, translating them in some type-specific manner. The typical use of this contract is for translating between internal and external identifiers.
    Since:
    Mar 26, 2014
    Author:
    ajs6f
    • Method Detail

      • inDomain

        public boolean inDomain​(A resource)
        Check if the given resource is in the domain of this converter
        Parameters:
        resource - the given resource
        Returns:
        boolean value of the check
      • toDomain

        public abstract A toDomain​(String resource)
        Convert a plain string to a resource appropriate to this converter
        Parameters:
        resource - the plain string resource
        Returns:
        the resource appropriate to this converter
      • asString

        public abstract String asString​(A resource)
        Convert the given resource into a plain string representation of the conversion to the resource
        Parameters:
        resource - the given resource
        Returns:
        a plain string representation of the conversion to the resource