
software.amazon.awssdk.services.proton.model.RepositorySyncDefinition Maven / Gradle / Ivy
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.proton.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* A repository sync definition.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class RepositorySyncDefinition implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField BRANCH_FIELD = SdkField. builder(MarshallingType.STRING).memberName("branch")
.getter(getter(RepositorySyncDefinition::branch)).setter(setter(Builder::branch))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("branch").build()).build();
private static final SdkField DIRECTORY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("directory").getter(getter(RepositorySyncDefinition::directory)).setter(setter(Builder::directory))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("directory").build()).build();
private static final SdkField PARENT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("parent")
.getter(getter(RepositorySyncDefinition::parent)).setter(setter(Builder::parent))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("parent").build()).build();
private static final SdkField TARGET_FIELD = SdkField. builder(MarshallingType.STRING).memberName("target")
.getter(getter(RepositorySyncDefinition::target)).setter(setter(Builder::target))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("target").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BRANCH_FIELD, DIRECTORY_FIELD,
PARENT_FIELD, TARGET_FIELD));
private static final long serialVersionUID = 1L;
private final String branch;
private final String directory;
private final String parent;
private final String target;
private RepositorySyncDefinition(BuilderImpl builder) {
this.branch = builder.branch;
this.directory = builder.directory;
this.parent = builder.parent;
this.target = builder.target;
}
/**
*
* The repository branch.
*
*
* @return The repository branch.
*/
public final String branch() {
return branch;
}
/**
*
* The directory in the repository.
*
*
* @return The directory in the repository.
*/
public final String directory() {
return directory;
}
/**
*
* The resource that is synced from.
*
*
* @return The resource that is synced from.
*/
public final String parent() {
return parent;
}
/**
*
* The resource that is synced to.
*
*
* @return The resource that is synced to.
*/
public final String target() {
return target;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(branch());
hashCode = 31 * hashCode + Objects.hashCode(directory());
hashCode = 31 * hashCode + Objects.hashCode(parent());
hashCode = 31 * hashCode + Objects.hashCode(target());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof RepositorySyncDefinition)) {
return false;
}
RepositorySyncDefinition other = (RepositorySyncDefinition) obj;
return Objects.equals(branch(), other.branch()) && Objects.equals(directory(), other.directory())
&& Objects.equals(parent(), other.parent()) && Objects.equals(target(), other.target());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("RepositorySyncDefinition").add("Branch", branch()).add("Directory", directory())
.add("Parent", parent()).add("Target", target()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "branch":
return Optional.ofNullable(clazz.cast(branch()));
case "directory":
return Optional.ofNullable(clazz.cast(directory()));
case "parent":
return Optional.ofNullable(clazz.cast(parent()));
case "target":
return Optional.ofNullable(clazz.cast(target()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy