io.sphere.sdk.types.Type Maven / Gradle / Ivy
package io.sphere.sdk.types;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.sphere.sdk.models.LocalizedString;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.models.Resource;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Set;
/**
@see Custom
*/
@JsonDeserialize(as = TypeImpl.class)
public interface Type extends Resource {
String getKey();
LocalizedString getName();
@Nullable
LocalizedString getDescription();
Set getResourceTypeIds();
List getFieldDefinitions();
@Nullable
FieldDefinition getFieldDefinitionByName(final String name);
@Override
default Reference toReference() {
return Reference.of(referenceTypeId(), getId(), this);
}
static String referenceTypeId(){
return "type";
}
static TypeReference typeReference() {
return new TypeReference() {
@Override
public String toString() {
return "TypeReference";
}
};
}
}