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

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

There is a newer version: 2.16.0
Show newest version
package io.sphere.sdk.models;

import io.sphere.sdk.types.CustomFields;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.Set;

final class AssetImpl extends Base implements Asset {
    private final String id;
    private final List sources;
    private final LocalizedString name;
    @Nullable
    private final LocalizedString description;
    private final Set tags;
    @Nullable
    private final CustomFields custom;

    @Nullable
    private final String key;


    AssetImpl(final String id, final String key, final List sources, final LocalizedString name, @Nullable final LocalizedString description, @Nullable final Set tags, @Nullable final CustomFields custom) {
        this.id = id;
        this.key = key;
        this.sources = sources;
        this.name = name;
        this.description = description;
        this.tags = tags == null ? Collections.emptySet() : tags;
        this.custom = custom;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    @Nullable
    public String getKey() {
        return key;
    }

    @Override
    public List getSources() {
        return sources;
    }

    @Override
    public LocalizedString getName() {
        return name;
    }

    @Override
    @Nullable
    public LocalizedString getDescription() {
        return description;
    }

    /**
     * Gets the tags belonging to this asset or an empty set.
     *
     * @return tags
     */
    @Override
    @Nonnull
    public Set getTags() {
        return tags;
    }

    @Override
    @Nullable
    public CustomFields getCustom() {
        return custom;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy