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

com.atlassian.bamboo.specs.api.model.jobcache.CacheItemProperties Maven / Gradle / Ivy

There is a newer version: 2.1.7
Show newest version
package com.atlassian.bamboo.specs.api.model.jobcache;

import com.atlassian.bamboo.specs.api.builders.jobcache.CacheItem;
import com.atlassian.bamboo.specs.api.codegen.annotations.Builder;
import com.atlassian.bamboo.specs.api.model.EntityProperties;
import com.atlassian.bamboo.specs.api.validators.common.ImporterUtils;
import com.atlassian.bamboo.specs.api.validators.common.ValidationContext;
import java.util.Objects;

@Builder(CacheItem.class)
public class CacheItemProperties implements EntityProperties {
    public static final ValidationContext VALIDATION_CONTEXT = ValidationContext.of("Job Cache Item");

    private String location;

    public CacheItemProperties() {}

    public CacheItemProperties(String location) {
        this.location = location;
    }

    public String getLocation() {
        return location;
    }

    @Override
    public void validate() {
        ImporterUtils.checkNotBlank(VALIDATION_CONTEXT, "location", location);
    }

    @Override
    public int hashCode() {
        return Objects.hash(location);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final CacheItemProperties other = (CacheItemProperties) obj;
        return Objects.equals(this.location, other.location);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy