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

com.labs64.utils.swid.builder.ResourceBuilder Maven / Gradle / Ivy

The newest version!
package com.labs64.utils.swid.builder;

import com.labs64.utils.swid.exception.SwidException;
import org.apache.commons.lang3.StringUtils;
import org.iso.standards.iso._19770.__2._2014_dis.schema.Resource;

public class ResourceBuilder extends BaseElementBuilder {

    /**
     * Sets the value of the type property.
     *
     * @param type
     *     allowed object is
     *     {@link String }
     * @return reference to this object
     */
    public ResourceBuilder type(String type) {
        item.setType(type);
        return this;
    }

    @Override
    protected void validate() {
        if (StringUtils.isBlank(item.getType())) {
            throw new SwidException("'resource.type' is not set");
        }
    }

    @Override
    protected Resource makeItem() {
        return new Resource();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy