
software.amazon.awssdk.services.glue.model.WorkflowRunStatistics 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.glue.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;
/**
*
* Workflow run statistics provides statistics about the workflow run.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class WorkflowRunStatistics implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField TOTAL_ACTIONS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(WorkflowRunStatistics::totalActions)).setter(setter(Builder::totalActions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TotalActions").build()).build();
private static final SdkField TIMEOUT_ACTIONS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(WorkflowRunStatistics::timeoutActions)).setter(setter(Builder::timeoutActions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimeoutActions").build()).build();
private static final SdkField FAILED_ACTIONS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(WorkflowRunStatistics::failedActions)).setter(setter(Builder::failedActions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailedActions").build()).build();
private static final SdkField STOPPED_ACTIONS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(WorkflowRunStatistics::stoppedActions)).setter(setter(Builder::stoppedActions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StoppedActions").build()).build();
private static final SdkField SUCCEEDED_ACTIONS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(WorkflowRunStatistics::succeededActions)).setter(setter(Builder::succeededActions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SucceededActions").build()).build();
private static final SdkField RUNNING_ACTIONS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(WorkflowRunStatistics::runningActions)).setter(setter(Builder::runningActions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RunningActions").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TOTAL_ACTIONS_FIELD,
TIMEOUT_ACTIONS_FIELD, FAILED_ACTIONS_FIELD, STOPPED_ACTIONS_FIELD, SUCCEEDED_ACTIONS_FIELD, RUNNING_ACTIONS_FIELD));
private static final long serialVersionUID = 1L;
private final Integer totalActions;
private final Integer timeoutActions;
private final Integer failedActions;
private final Integer stoppedActions;
private final Integer succeededActions;
private final Integer runningActions;
private WorkflowRunStatistics(BuilderImpl builder) {
this.totalActions = builder.totalActions;
this.timeoutActions = builder.timeoutActions;
this.failedActions = builder.failedActions;
this.stoppedActions = builder.stoppedActions;
this.succeededActions = builder.succeededActions;
this.runningActions = builder.runningActions;
}
/**
*
* Total number of Actions in the workflow run.
*
*
* @return Total number of Actions in the workflow run.
*/
public Integer totalActions() {
return totalActions;
}
/**
*
* Total number of Actions which timed out.
*
*
* @return Total number of Actions which timed out.
*/
public Integer timeoutActions() {
return timeoutActions;
}
/**
*
* Total number of Actions which have failed.
*
*
* @return Total number of Actions which have failed.
*/
public Integer failedActions() {
return failedActions;
}
/**
*
* Total number of Actions which have stopped.
*
*
* @return Total number of Actions which have stopped.
*/
public Integer stoppedActions() {
return stoppedActions;
}
/**
*
* Total number of Actions which have succeeded.
*
*
* @return Total number of Actions which have succeeded.
*/
public Integer succeededActions() {
return succeededActions;
}
/**
*
* Total number Actions in running state.
*
*
* @return Total number Actions in running state.
*/
public Integer runningActions() {
return runningActions;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(totalActions());
hashCode = 31 * hashCode + Objects.hashCode(timeoutActions());
hashCode = 31 * hashCode + Objects.hashCode(failedActions());
hashCode = 31 * hashCode + Objects.hashCode(stoppedActions());
hashCode = 31 * hashCode + Objects.hashCode(succeededActions());
hashCode = 31 * hashCode + Objects.hashCode(runningActions());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof WorkflowRunStatistics)) {
return false;
}
WorkflowRunStatistics other = (WorkflowRunStatistics) obj;
return Objects.equals(totalActions(), other.totalActions()) && Objects.equals(timeoutActions(), other.timeoutActions())
&& Objects.equals(failedActions(), other.failedActions())
&& Objects.equals(stoppedActions(), other.stoppedActions())
&& Objects.equals(succeededActions(), other.succeededActions())
&& Objects.equals(runningActions(), other.runningActions());
}
/**
* 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 String toString() {
return ToString.builder("WorkflowRunStatistics").add("TotalActions", totalActions())
.add("TimeoutActions", timeoutActions()).add("FailedActions", failedActions())
.add("StoppedActions", stoppedActions()).add("SucceededActions", succeededActions())
.add("RunningActions", runningActions()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "TotalActions":
return Optional.ofNullable(clazz.cast(totalActions()));
case "TimeoutActions":
return Optional.ofNullable(clazz.cast(timeoutActions()));
case "FailedActions":
return Optional.ofNullable(clazz.cast(failedActions()));
case "StoppedActions":
return Optional.ofNullable(clazz.cast(stoppedActions()));
case "SucceededActions":
return Optional.ofNullable(clazz.cast(succeededActions()));
case "RunningActions":
return Optional.ofNullable(clazz.cast(runningActions()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy