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

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

The newest version!
package io.sphere.sdk.models;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

import javax.annotation.Nullable;

@JsonDeserialize(as = KeyReferenceImpl.class)
public interface KeyReference  {

    /**
     * Key of the object this reference represents.
     * @return the id
     */
    String getKey();

    /**
     * Type id of the object this reference represents, e.g. "customer".
     * @return the type id
     */
    String getTypeId();

    @Nullable
    T getObj();
    
    public static  KeyReference of(final String key, final String typeId) {
        return new KeyReferenceImpl<>(key, typeId, null);
    }
    
    public static  KeyReference of(final String key, final String typeId, @Nullable final T obj) {
        return new KeyReferenceImpl<>(key, typeId, obj);
    }
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy