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

io.sphere.sdk.models.Referenceable Maven / Gradle / Ivy

There is a newer version: 1.0.0-M26
Show newest version
package io.sphere.sdk.models;

/**
 * Represents an object itself or a {@link io.sphere.sdk.models.Reference} to it.
 * It is not necessarily the case that the reference is filled.
 *
 * @param  the type of the referenced object.
 */
public interface Referenceable {
    /**
     * Creates a reference which is not necessarily filled.
     * @return reference
     */
    Reference toReference();

    default boolean hasSameIdAs(final Referenceable other) {
        return toReference().getId().equals(other.toReference().getId());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy