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

io.sphere.sdk.types.Type Maven / Gradle / Ivy

There is a newer version: 1.0.0-M26
Show newest version
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";
            }
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy