io.imunity.upman.rest.RestProjectUpdateRequest Maven / Gradle / Ivy
/*
* Copyright (c) 2018 Bixbit - Krzysztof Benedyczak. All rights reserved.
* See LICENCE.txt file for licensing information.
*/
package io.imunity.upman.rest;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@JsonDeserialize(builder = RestProjectUpdateRequest.RestProjectBuilder.class)
class RestProjectUpdateRequest
{
@JsonProperty("public")
final boolean isPublic;
final Map displayedName;
final Map description;
final boolean enableDelegation;
final String logoUrl;
final boolean enableSubprojects;
final List readOnlyAttributes;
RestProjectUpdateRequest(boolean isPublic, Map displayedName,
Map description, boolean enableDelegation,
String logoUrl, boolean enableSubprojects, List readOnlyAttributes)
{
this.isPublic = isPublic;
this.displayedName = displayedName;
this.description = description;
this.enableDelegation = enableDelegation;
this.logoUrl = logoUrl;
this.enableSubprojects = enableSubprojects;
this.readOnlyAttributes = readOnlyAttributes;
}
@Override
public boolean equals(Object o)
{
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RestProjectUpdateRequest that = (RestProjectUpdateRequest) o;
return isPublic == that.isPublic && enableDelegation == that.enableDelegation &&
enableSubprojects == that.enableSubprojects &&
Objects.equals(displayedName, that.displayedName) &&
Objects.equals(description, that.description) &&
Objects.equals(logoUrl, that.logoUrl) &&
Objects.equals(readOnlyAttributes, that.readOnlyAttributes);
}
@Override
public int hashCode()
{
return Objects.hash(isPublic, displayedName, description, enableDelegation, logoUrl,
enableSubprojects, readOnlyAttributes);
}
@Override
public String toString()
{
return "RestProject{" +
", isPublic=" + isPublic +
", displayedName=" + displayedName +
", description=" + description +
", enableDelegation=" + enableDelegation +
", logoUrl='" + logoUrl + '\'' +
", enableSubprojects=" + enableSubprojects +
", readOnlyAttributes='" + readOnlyAttributes + '\'' +
'}';
}
public static RestProjectBuilder builder()
{
return new RestProjectBuilder();
}
public static final class RestProjectBuilder
{
private boolean isPublic;
private Map displayedName;
private Map description;
private boolean enableDelegation;
private String logoUrl;
private boolean enableSubprojects;
private List readOnlyAttributes;
private RestProjectBuilder()
{
}
public RestProjectBuilder withPublic(boolean isPublic)
{
this.isPublic = isPublic;
return this;
}
public RestProjectBuilder withDisplayedName(Map displayedName)
{
this.displayedName = displayedName;
return this;
}
public RestProjectBuilder withDescription(Map description)
{
this.description = description;
return this;
}
public RestProjectBuilder withEnableDelegation(boolean enableDelegation)
{
this.enableDelegation = enableDelegation;
return this;
}
public RestProjectBuilder withLogoUrl(String logoUrl)
{
this.logoUrl = logoUrl;
return this;
}
public RestProjectBuilder withEnableSubprojects(boolean enableSubprojects)
{
this.enableSubprojects = enableSubprojects;
return this;
}
public RestProjectBuilder withReadOnlyAttributes(List readOnlyAttributes)
{
this.readOnlyAttributes = readOnlyAttributes;
return this;
}
public RestProjectUpdateRequest build()
{
return new RestProjectUpdateRequest(isPublic, displayedName, description, enableDelegation, logoUrl,
enableSubprojects, readOnlyAttributes);
}
}
}