io.sphere.sdk.models.Referenceable Maven / Gradle / Ivy
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