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

com.enofex.naikan.model.AbstractContainer Maven / Gradle / Ivy

Go to download

The Naikan Model Module for Naikan the software inventory management tool for dev teams driven by our CI/CD pipeline.

The newest version!
package com.enofex.naikan.model;

import java.util.Iterator;
import java.util.List;
import java.util.Objects;

public abstract class AbstractContainer implements Iterable {

  private final List entries;

  AbstractContainer(List entries) {
    this.entries = entries != null ? entries : List.of();
  }

  public List all() {
    return this.entries;
  }

  public int lastIndex() {
    return this.entries.size() - 1;
  }

  @Override
  public Iterator iterator() {
    return this.entries.iterator();
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    AbstractContainer that = (AbstractContainer) o;

    return Objects.equals(this.entries, that.entries);
  }

  @Override
  public int hashCode() {
    return Objects.hash(this.entries);
  }

  @Override
  public String toString() {
    return Objects.toString(this.entries);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy