All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.restup.path.PathValue Maven / Gradle / Ivy

There is a newer version: 0.0.5
Show newest version
package com.github.restup.path;

/**
 * An item of a {@link ResourcePath} representing a single portion of the full path
 */
public interface PathValue {

    /**
     * @return the api name of the path
     */
    String getApiPath();

    /**
     * @return the bean name of the path
     */
    String getBeanPath();

    /**
     * @return the persisted name of the path
     */
    String getPersistedPath();

    /**
     * @param instance type to confirm is supported by the {@link PathValue}
     * @return true if the {@link PathValue} supports the type specified, false otherwise
     */
    boolean supportsType(Class instance);

    /**
     * @return true if the path represents a reserved path (type, id, data, included, linking, etc)
     */
    default boolean isReservedPath() {
        return false;
    }

    static InvalidPathValue invalid(String field) {
        return new InvalidPathValue(field);
    }

    static DataPathValue data() {
        return DataPathValue.getInstance();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy