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

io.sphere.client.model.ReferenceId Maven / Gradle / Ivy

There is a newer version: 0.72.1
Show newest version
package io.sphere.client.model;

import javax.annotation.Nonnull;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;

@JsonIgnoreProperties({"expanded"})
public class ReferenceId {
    @Nonnull private String id;
    @Nonnull private String typeId;

    // for JSON deserializer
    protected ReferenceId() { }

    private ReferenceId(@Nonnull String typeId, @Nonnull String id) {
        this.id = id;
        this.typeId = typeId;
    }

    public static  ReferenceId create(String typeId, String id) {
        return new ReferenceId(typeId, id);
    }

    /** Id of the object this reference represents. */
    @Nonnull public String getId() { return id; }

    /** Type id of the object this reference represents, e.g. "customer". */
    @Nonnull public String getTypeId() { return typeId; }

    @Override public String toString() {
        return "[Reference " + getTypeId() + " " + getId() + "]";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy