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

io.honnix.rkt.launcher.model.PodBuilder Maven / Gradle / Ivy

package io.honnix.rkt.launcher.model;

import io.norberg.automatter.AutoMatter;
import java.time.Instant;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Generated;

@Generated("io.norberg.automatter.processor.AutoMatterProcessor")
public final class PodBuilder {
  private String name;

  private String state;

  private Optional> networks;

  private Optional> appNames;

  private Optional startedAt;

  private Optional> userAnnotations;

  private Optional> userLabels;

  public PodBuilder() {
    this.networks = Optional.empty();
    this.appNames = Optional.empty();
    this.startedAt = Optional.empty();
    this.userAnnotations = Optional.empty();
    this.userLabels = Optional.empty();
  }

  private PodBuilder(Pod v) {
    this.name = v.name();
    this.state = v.state();
    this.networks = v.networks();
    this.appNames = v.appNames();
    this.startedAt = v.startedAt();
    this.userAnnotations = v.userAnnotations();
    this.userLabels = v.userLabels();
  }

  private PodBuilder(PodBuilder v) {
    this.name = v.name;
    this.state = v.state;
    this.networks = v.networks;
    this.appNames = v.appNames;
    this.startedAt = v.startedAt;
    this.userAnnotations = v.userAnnotations;
    this.userLabels = v.userLabels;
  }

  public String name() {
    return name;
  }

  public PodBuilder name(String name) {
    if (name == null) {
      throw new NullPointerException("name");
    }
    this.name = name;
    return this;
  }

  public String state() {
    return state;
  }

  public PodBuilder state(String state) {
    if (state == null) {
      throw new NullPointerException("state");
    }
    this.state = state;
    return this;
  }

  public Optional> networks() {
    return networks;
  }

  public PodBuilder networks(List networks) {
    return networks(Optional.ofNullable(networks));
  }

  @SuppressWarnings("unchecked")
  public PodBuilder networks(Optional> networks) {
    if (networks == null) {
      throw new NullPointerException("networks");
    }
    this.networks = (Optional>)networks;
    return this;
  }

  public Optional> appNames() {
    return appNames;
  }

  public PodBuilder appNames(List appNames) {
    return appNames(Optional.ofNullable(appNames));
  }

  @SuppressWarnings("unchecked")
  public PodBuilder appNames(Optional> appNames) {
    if (appNames == null) {
      throw new NullPointerException("appNames");
    }
    this.appNames = (Optional>)appNames;
    return this;
  }

  public Optional startedAt() {
    return startedAt;
  }

  public PodBuilder startedAt(Instant startedAt) {
    return startedAt(Optional.ofNullable(startedAt));
  }

  @SuppressWarnings("unchecked")
  public PodBuilder startedAt(Optional startedAt) {
    if (startedAt == null) {
      throw new NullPointerException("startedAt");
    }
    this.startedAt = (Optional)startedAt;
    return this;
  }

  public Optional> userAnnotations() {
    return userAnnotations;
  }

  public PodBuilder userAnnotations(Map userAnnotations) {
    return userAnnotations(Optional.ofNullable(userAnnotations));
  }

  @SuppressWarnings("unchecked")
  public PodBuilder userAnnotations(Optional> userAnnotations) {
    if (userAnnotations == null) {
      throw new NullPointerException("userAnnotations");
    }
    this.userAnnotations = (Optional>)userAnnotations;
    return this;
  }

  public Optional> userLabels() {
    return userLabels;
  }

  public PodBuilder userLabels(Map userLabels) {
    return userLabels(Optional.ofNullable(userLabels));
  }

  @SuppressWarnings("unchecked")
  public PodBuilder userLabels(Optional> userLabels) {
    if (userLabels == null) {
      throw new NullPointerException("userLabels");
    }
    this.userLabels = (Optional>)userLabels;
    return this;
  }

  public Pod build() {
    return new Value(name, state, networks, appNames, startedAt, userAnnotations, userLabels);
  }

  public static PodBuilder from(Pod v) {
    return new PodBuilder(v);
  }

  public static PodBuilder from(PodBuilder v) {
    return new PodBuilder(v);
  }

  private static final class Value implements Pod {
    private final String name;

    private final String state;

    private final Optional> networks;

    private final Optional> appNames;

    private final Optional startedAt;

    private final Optional> userAnnotations;

    private final Optional> userLabels;

    private Value(@AutoMatter.Field("name") String name, @AutoMatter.Field("state") String state, @AutoMatter.Field("networks") Optional> networks, @AutoMatter.Field("appNames") Optional> appNames, @AutoMatter.Field("startedAt") Optional startedAt, @AutoMatter.Field("userAnnotations") Optional> userAnnotations, @AutoMatter.Field("userLabels") Optional> userLabels) {
      if (name == null) {
        throw new NullPointerException("name");
      }
      if (state == null) {
        throw new NullPointerException("state");
      }
      if (networks == null) {
        throw new NullPointerException("networks");
      }
      if (appNames == null) {
        throw new NullPointerException("appNames");
      }
      if (startedAt == null) {
        throw new NullPointerException("startedAt");
      }
      if (userAnnotations == null) {
        throw new NullPointerException("userAnnotations");
      }
      if (userLabels == null) {
        throw new NullPointerException("userLabels");
      }
      this.name = name;
      this.state = state;
      this.networks = networks;
      this.appNames = appNames;
      this.startedAt = startedAt;
      this.userAnnotations = userAnnotations;
      this.userLabels = userLabels;
    }

    @AutoMatter.Field
    @Override
    public String name() {
      return name;
    }

    @AutoMatter.Field
    @Override
    public String state() {
      return state;
    }

    @AutoMatter.Field
    @Override
    public Optional> networks() {
      return networks;
    }

    @AutoMatter.Field
    @Override
    public Optional> appNames() {
      return appNames;
    }

    @AutoMatter.Field
    @Override
    public Optional startedAt() {
      return startedAt;
    }

    @AutoMatter.Field
    @Override
    public Optional> userAnnotations() {
      return userAnnotations;
    }

    @AutoMatter.Field
    @Override
    public Optional> userLabels() {
      return userLabels;
    }

    public PodBuilder builder() {
      return new PodBuilder(this);
    }

    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (!(o instanceof Pod)) {
        return false;
      }
      final Pod that = (Pod) o;
      if (name != null ? !name.equals(that.name()) : that.name() != null) {
        return false;
      }
      if (state != null ? !state.equals(that.state()) : that.state() != null) {
        return false;
      }
      if (networks != null ? !networks.equals(that.networks()) : that.networks() != null) {
        return false;
      }
      if (appNames != null ? !appNames.equals(that.appNames()) : that.appNames() != null) {
        return false;
      }
      if (startedAt != null ? !startedAt.equals(that.startedAt()) : that.startedAt() != null) {
        return false;
      }
      if (userAnnotations != null ? !userAnnotations.equals(that.userAnnotations()) : that.userAnnotations() != null) {
        return false;
      }
      if (userLabels != null ? !userLabels.equals(that.userLabels()) : that.userLabels() != null) {
        return false;
      }
      return true;
    }

    @Override
    public int hashCode() {
      int result = 1;
      long temp;
      result = 31 * result + (name != null ? name.hashCode() : 0);
      result = 31 * result + (state != null ? state.hashCode() : 0);
      result = 31 * result + (networks != null ? networks.hashCode() : 0);
      result = 31 * result + (appNames != null ? appNames.hashCode() : 0);
      result = 31 * result + (startedAt != null ? startedAt.hashCode() : 0);
      result = 31 * result + (userAnnotations != null ? userAnnotations.hashCode() : 0);
      result = 31 * result + (userLabels != null ? userLabels.hashCode() : 0);
      return result;
    }

    @Override
    public String toString() {
      return "Pod{" +
      "name=" + name +
      ", state=" + state +
      ", networks=" + networks +
      ", appNames=" + appNames +
      ", startedAt=" + startedAt +
      ", userAnnotations=" + userAnnotations +
      ", userLabels=" + userLabels +
      '}';
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy