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 extends ResourceIdentifiable {
/**
* Creates a reference which is not necessarily filled.
* @return reference
*/
Reference toReference();
@Override
default ResourceIdentifier toResourceIdentifier() {
return toReference();
}
default boolean hasSameIdAs(final Referenceable other) {
return toReference().getId().equals(other.toReference().getId());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy