
com.solidfire.element.api.Schedule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of solidfire-sdk-java Show documentation
Show all versions of solidfire-sdk-java Show documentation
Library for interfacing with the Public and Incubating SolidFire Element API.
/*
* Copyright © 2014-2016 NetApp, Inc. 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License 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.
*/
/*
* DO NOT EDIT THIS CODE BY HAND! It has been generated with jsvcgen.
*/
package com.solidfire.element.api;
import com.solidfire.gson.annotations.SerializedName;
import com.solidfire.core.annotation.Since;
import com.solidfire.core.javautil.Optional;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Objects;
/**
* Schedule
* Schedule is an object containing information about each schedule created to autonomously make a snapshot of a volume. The return object includes information for all schedules. If scheduleID is used to identify a specific schedule then only information for that scheduleID is returned. Schedules information is returned with the API method, see ListSchedules on the SolidFire API guide page 245.
**/
public class Schedule implements Serializable {
public static final long serialVersionUID = -5892117456652543449L;
@SerializedName("frequency") private Frequency frequency;
@SerializedName("hasError") private Optional hasError;
@SerializedName("lastRunStatus") private String lastRunStatus;
@SerializedName("lastRunTimeStarted") private String lastRunTimeStarted;
@SerializedName("paused") private Optional paused;
@SerializedName("recurring") private Optional recurring;
@SerializedName("runNextInterval") private Optional runNextInterval;
@SerializedName("scheduleID") private Optional scheduleID;
@SerializedName("scheduleInfo") private ScheduleInfo scheduleInfo;
@SerializedName("name") private String name;
@SerializedName("startingDate") private String startingDate;
@SerializedName("toBeDeleted") private Optional toBeDeleted;
// empty constructor
@Since("7.0")
public Schedule() {}
// parameterized constructor
@Since("7.0")
public Schedule(
Frequency frequency,
Optional hasError,
String lastRunStatus,
String lastRunTimeStarted,
Optional paused,
Optional recurring,
Optional runNextInterval,
Optional scheduleID,
ScheduleInfo scheduleInfo,
String name,
String startingDate,
Optional toBeDeleted
)
{
this.frequency = frequency;
this.hasError = (hasError == null) ? Optional.empty() : hasError;
this.lastRunStatus = lastRunStatus;
this.lastRunTimeStarted = lastRunTimeStarted;
this.paused = (paused == null) ? Optional.empty() : paused;
this.recurring = (recurring == null) ? Optional.empty() : recurring;
this.runNextInterval = (runNextInterval == null) ? Optional.empty() : runNextInterval;
this.scheduleID = (scheduleID == null) ? Optional.empty() : scheduleID;
this.scheduleInfo = scheduleInfo;
this.name = name;
this.startingDate = startingDate;
this.toBeDeleted = (toBeDeleted == null) ? Optional.empty() : toBeDeleted;
}
/**
* Indicates the frequency of the schedule occurrence. Set this to a type that inherits from Frequency.
* Valid types are:
* DayOfWeekFrequency
* DayOfMonthFrequency
* TimeIntervalFrequency
**/
public Frequency getFrequency() { return this.frequency; }
public void setFrequency(Frequency frequency) {
this.frequency = frequency;
}
/**
* Indicates whether or not the schedule has errors.
**/
public Optional getHasError() { return this.hasError; }
public void setHasError(Optional hasError) {
this.hasError = (hasError == null) ? Optional.empty() : hasError;
}
/**
* Indicates the status of the last scheduled snapshot.
* Valid values are:
* Success
* Failed
**/
public String getLastRunStatus() { return this.lastRunStatus; }
public void setLastRunStatus(String lastRunStatus) {
this.lastRunStatus = lastRunStatus;
}
/**
* Indicates the last time the schedule started n ISO 8601 date string.
* Valid values are:
* Success
* Failed
**/
public String getLastRunTimeStarted() { return this.lastRunTimeStarted; }
public void setLastRunTimeStarted(String lastRunTimeStarted) {
this.lastRunTimeStarted = lastRunTimeStarted;
}
/**
* Indicates whether or not the schedule is paused.
**/
public Optional getPaused() { return this.paused; }
public void setPaused(Optional paused) {
this.paused = (paused == null) ? Optional.empty() : paused;
}
/**
* Indicates whether or not the schedule is recurring.
**/
public Optional getRecurring() { return this.recurring; }
public void setRecurring(Optional recurring) {
this.recurring = (recurring == null) ? Optional.empty() : recurring;
}
/**
* Indicates whether or not the schedule will run the next time the scheduler is active. When set to "true", the schedule will run the next time the scheduler is active and then reset back to "false".
**/
public Optional getRunNextInterval() { return this.runNextInterval; }
public void setRunNextInterval(Optional runNextInterval) {
this.runNextInterval = (runNextInterval == null) ? Optional.empty() : runNextInterval;
}
/**
* Unique ID of the schedule
**/
public Optional getScheduleID() { return this.scheduleID; }
public void setScheduleID(Optional scheduleID) {
this.scheduleID = (scheduleID == null) ? Optional.empty() : scheduleID;
}
/**
* Includes the unique name given to the schedule, the retention period for the snapshot that was created, and the volume ID of the volume from which the snapshot was created.
**/
public ScheduleInfo getScheduleInfo() { return this.scheduleInfo; }
public void setScheduleInfo(ScheduleInfo scheduleInfo) {
this.scheduleInfo = scheduleInfo;
}
/**
* Unique name assigned to the schedule.
**/
public String getName() { return this.name; }
public void setName(String name) {
this.name = name;
}
/**
* Indicates the date the first time the schedule began of will begin. Formatted in UTC time.
**/
public String getStartingDate() { return this.startingDate; }
public void setStartingDate(String startingDate) {
this.startingDate = startingDate;
}
/**
* Indicates if the schedule is marked for deletion.
**/
public Optional getToBeDeleted() { return this.toBeDeleted; }
public void setToBeDeleted(Optional toBeDeleted) {
this.toBeDeleted = (toBeDeleted == null) ? Optional.empty() : toBeDeleted;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Schedule that = (Schedule) o;
return
Objects.equals(frequency, that.frequency) &&
Objects.equals(hasError, that.hasError) &&
Objects.equals(lastRunStatus, that.lastRunStatus) &&
Objects.equals(lastRunTimeStarted, that.lastRunTimeStarted) &&
Objects.equals(paused, that.paused) &&
Objects.equals(recurring, that.recurring) &&
Objects.equals(runNextInterval, that.runNextInterval) &&
Objects.equals(scheduleID, that.scheduleID) &&
Objects.equals(scheduleInfo, that.scheduleInfo) &&
Objects.equals(name, that.name) &&
Objects.equals(startingDate, that.startingDate) &&
Objects.equals(toBeDeleted, that.toBeDeleted);
}
@Override
public int hashCode() {
return Objects.hash( frequency,hasError,lastRunStatus,lastRunTimeStarted,paused,recurring,runNextInterval,scheduleID,scheduleInfo,name,startingDate,toBeDeleted );
}
public java.util.Map toMap() {
java.util.Map map = new HashMap<>();
map.put("frequency", frequency);
map.put("hasError", hasError);
map.put("lastRunStatus", lastRunStatus);
map.put("lastRunTimeStarted", lastRunTimeStarted);
map.put("paused", paused);
map.put("recurring", recurring);
map.put("runNextInterval", runNextInterval);
map.put("scheduleID", scheduleID);
map.put("scheduleInfo", scheduleInfo);
map.put("name", name);
map.put("startingDate", startingDate);
map.put("toBeDeleted", toBeDeleted);
return map;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append( "{ " );
sb.append(" frequency : ").append(frequency).append(",");
if(null != hasError && hasError.isPresent()){
sb.append(" hasError : ").append(hasError).append(",");
}
sb.append(" lastRunStatus : ").append(lastRunStatus).append(",");
sb.append(" lastRunTimeStarted : ").append(lastRunTimeStarted).append(",");
if(null != paused && paused.isPresent()){
sb.append(" paused : ").append(paused).append(",");
}
if(null != recurring && recurring.isPresent()){
sb.append(" recurring : ").append(recurring).append(",");
}
if(null != runNextInterval && runNextInterval.isPresent()){
sb.append(" runNextInterval : ").append(runNextInterval).append(",");
}
if(null != scheduleID && scheduleID.isPresent()){
sb.append(" scheduleID : ").append(scheduleID).append(",");
}
sb.append(" scheduleInfo : ").append(scheduleInfo).append(",");
sb.append(" name : ").append(name).append(",");
sb.append(" startingDate : ").append(startingDate).append(",");
if(null != toBeDeleted && toBeDeleted.isPresent()){
sb.append(" toBeDeleted : ").append(toBeDeleted).append(",");
}
sb.append( " }" );
if(sb.lastIndexOf(", }") != -1)
sb.deleteCharAt(sb.lastIndexOf(", }"));
return sb.toString();
}
public static Builder builder() {
return new Builder();
}
public final Builder asBuilder() {
return new Builder().buildFrom(this);
}
public static class Builder {
private Frequency frequency;
private Optional hasError;
private String lastRunStatus;
private String lastRunTimeStarted;
private Optional paused;
private Optional recurring;
private Optional runNextInterval;
private Optional scheduleID;
private ScheduleInfo scheduleInfo;
private String name;
private String startingDate;
private Optional toBeDeleted;
private Builder() { }
public Schedule build() {
return new Schedule (
this.frequency,
this.hasError,
this.lastRunStatus,
this.lastRunTimeStarted,
this.paused,
this.recurring,
this.runNextInterval,
this.scheduleID,
this.scheduleInfo,
this.name,
this.startingDate,
this.toBeDeleted);
}
private Schedule.Builder buildFrom(final Schedule req) {
this.frequency = req.frequency;
this.hasError = req.hasError;
this.lastRunStatus = req.lastRunStatus;
this.lastRunTimeStarted = req.lastRunTimeStarted;
this.paused = req.paused;
this.recurring = req.recurring;
this.runNextInterval = req.runNextInterval;
this.scheduleID = req.scheduleID;
this.scheduleInfo = req.scheduleInfo;
this.name = req.name;
this.startingDate = req.startingDate;
this.toBeDeleted = req.toBeDeleted;
return this;
}
public Schedule.Builder frequency(final Frequency frequency) {
this.frequency = frequency;
return this;
}
public Schedule.Builder optionalHasError(final Boolean hasError) {
this.hasError = (hasError == null) ? Optional.empty() : Optional.of(hasError);
return this;
}
public Schedule.Builder lastRunStatus(final String lastRunStatus) {
this.lastRunStatus = lastRunStatus;
return this;
}
public Schedule.Builder lastRunTimeStarted(final String lastRunTimeStarted) {
this.lastRunTimeStarted = lastRunTimeStarted;
return this;
}
public Schedule.Builder optionalPaused(final Boolean paused) {
this.paused = (paused == null) ? Optional.empty() : Optional.of(paused);
return this;
}
public Schedule.Builder optionalRecurring(final Boolean recurring) {
this.recurring = (recurring == null) ? Optional.empty() : Optional.of(recurring);
return this;
}
public Schedule.Builder optionalRunNextInterval(final Boolean runNextInterval) {
this.runNextInterval = (runNextInterval == null) ? Optional.empty() : Optional.of(runNextInterval);
return this;
}
public Schedule.Builder optionalScheduleID(final Long scheduleID) {
this.scheduleID = (scheduleID == null) ? Optional.empty() : Optional.of(scheduleID);
return this;
}
public Schedule.Builder scheduleInfo(final ScheduleInfo scheduleInfo) {
this.scheduleInfo = scheduleInfo;
return this;
}
public Schedule.Builder name(final String name) {
this.name = name;
return this;
}
public Schedule.Builder startingDate(final String startingDate) {
this.startingDate = startingDate;
return this;
}
public Schedule.Builder optionalToBeDeleted(final Boolean toBeDeleted) {
this.toBeDeleted = (toBeDeleted == null) ? Optional.empty() : Optional.of(toBeDeleted);
return this;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy