au.gov.amsa.ihs.model.Ship Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ihs-reader Show documentation
Show all versions of ihs-reader Show documentation
Reads IHS zipped xml data files
package au.gov.amsa.ihs.model;
import java.time.OffsetDateTime;
import java.util.Optional;
import com.github.davidmoten.guavamini.Preconditions;
public class Ship {
private final String imo;
private final Optional mmsi;
private final Optional type2;
private final Optional type3;
private final Optional type4;
private final Optional type5;
private final Optional grossTonnage;
private final Optional classificationSocietyCode;
private final Optional flagCode;
private final Optional groupBeneficialOwnerCompanyCode;
private final Optional groupBeneficialOwnerCountryOfDomicileCode;
private final Optional countryOfBuildCode;
private final Optional yearOfBuild;
private final Optional monthOfBuild;
private final Optional deadweightTonnage;
private final Optional statCode5;
private final Optional lengthOverallMetres;
private final Optional breadthMetres;
private final Optional displacementTonnage;
private final Optional draughtMetres;
private final Optional speedKnots;
private final Optional lastUpdateTime;
private final Optional name;
private final Optional shipBuilderCompanyCode;
private Ship(String imo, Optional mmsi, Optional type2, Optional type3,
Optional type4, Optional type5, Optional grossTonnage,
Optional classificationSocietyCode, Optional flagCode,
Optional groupBeneficialOwnerCompanyCode,
Optional groupBeneficialOwnerCountryOfDomicileCode,
Optional countryOfBuildCode, Optional yearOfBuild,
Optional monthOfBuild, Optional deadweightTonnage,
Optional statCode5, Optional lengthOverallMetres,
Optional breadthMetres, Optional displacementTonnage,
Optional draughtMetres, Optional speedKnots,
Optional lastUpdateTime, Optional name,
Optional shipBuilderCompanyCode) {
Preconditions.checkNotNull(imo);
Preconditions.checkNotNull(mmsi);
Preconditions.checkNotNull(type2);
Preconditions.checkNotNull(type3);
Preconditions.checkNotNull(type4);
Preconditions.checkNotNull(type5);
Preconditions.checkNotNull(grossTonnage);
Preconditions.checkNotNull(classificationSocietyCode);
Preconditions.checkNotNull(flagCode);
Preconditions.checkNotNull(groupBeneficialOwnerCompanyCode);
Preconditions.checkNotNull(groupBeneficialOwnerCountryOfDomicileCode);
Preconditions.checkNotNull(countryOfBuildCode);
Preconditions.checkNotNull(yearOfBuild);
Preconditions.checkNotNull(monthOfBuild);
Preconditions.checkNotNull(deadweightTonnage);
Preconditions.checkNotNull(statCode5);
Preconditions.checkNotNull(lengthOverallMetres);
Preconditions.checkNotNull(breadthMetres);
Preconditions.checkNotNull(displacementTonnage);
Preconditions.checkNotNull(draughtMetres);
Preconditions.checkNotNull(speedKnots);
Preconditions.checkNotNull(lastUpdateTime);
Preconditions.checkNotNull(name);
Preconditions.checkNotNull(shipBuilderCompanyCode);
this.imo = imo;
this.mmsi = mmsi;
this.type2 = type2;
this.type3 = type3;
this.type4 = type4;
this.type5 = type5;
this.grossTonnage = grossTonnage;
this.classificationSocietyCode = classificationSocietyCode;
this.flagCode = flagCode;
this.groupBeneficialOwnerCompanyCode = groupBeneficialOwnerCompanyCode;
this.groupBeneficialOwnerCountryOfDomicileCode = groupBeneficialOwnerCountryOfDomicileCode;
this.countryOfBuildCode = countryOfBuildCode;
this.yearOfBuild = yearOfBuild;
this.monthOfBuild = monthOfBuild;
this.deadweightTonnage = deadweightTonnage;
this.statCode5 = statCode5;
this.lengthOverallMetres = lengthOverallMetres;
this.breadthMetres = breadthMetres;
if (displacementTonnage.isPresent() && displacementTonnage.get() == 0)
this.displacementTonnage = Optional.empty();
else
this.displacementTonnage = displacementTonnage;
this.draughtMetres = draughtMetres;
this.speedKnots = speedKnots;
this.lastUpdateTime = lastUpdateTime;
this.name = name;
this.shipBuilderCompanyCode = shipBuilderCompanyCode;
}
public Optional getName() {
return name;
}
public String getImo() {
return imo;
}
public Optional getMmsi() {
return mmsi;
}
public Optional getType2() {
return type2;
}
public Optional getType3() {
return type3;
}
public Optional getType4() {
return type4;
}
public Optional getType5() {
return type5;
}
public Optional getGrossTonnage() {
return grossTonnage;
}
public Optional getClassificationSocietyCode() {
return classificationSocietyCode;
}
public Optional getFlagCode() {
return flagCode;
}
public Optional getGroupBeneficialOwnerCompanyCode() {
return groupBeneficialOwnerCompanyCode;
}
public Optional getGroupBeneficialOwnerCountryOfDomicileCode() {
return groupBeneficialOwnerCountryOfDomicileCode;
}
public Optional getCountryOfBuildCode() {
return countryOfBuildCode;
}
public Optional getYearOfBuild() {
return yearOfBuild;
}
public Optional getMonthOfBuild() {
return monthOfBuild;
}
public Optional getDeadweightTonnage() {
return deadweightTonnage;
}
public Optional getStatCode5() {
return statCode5;
}
public Optional getLengthOverallMetres() {
return lengthOverallMetres;
}
public Optional getBreadthMetres() {
return breadthMetres;
}
public Optional getDisplacementTonnage() {
return displacementTonnage;
}
public Optional getDraughtMetres() {
return draughtMetres;
}
public Optional getSpeedKnots() {
return speedKnots;
}
public Optional getLastUpdateTime() {
return lastUpdateTime;
}
public Optional getShipBuilderCompanyCode() {
return shipBuilderCompanyCode;
}
public static Builder builder() {
return new Builder();
}
public static class Builder {
private String imo;
private Optional mmsi;
private Optional type2;
private Optional type3;
private Optional type4;
private Optional type5;
private Optional grossTonnage;
private Optional classificationSocietyCode;
private Optional flagCode;
private Optional groupBeneficialOwnerCompanyCode;
private Optional groupBeneficialOwnerCountryOfDomicileCode;
private Optional countryOfBuildCode;
private Optional yearOfBuild;
private Optional monthOfBuild;
private Optional deadweightTonnage;
private Optional statCode5;
private Optional lengthOverallMetres;
private Optional breadthMetres;
private Optional displacementTonnage;
private Optional draughtMetres;
private Optional speedKnots;
private Optional lastUpdateTime;
private Optional name;
private Optional shipBuilderCompanyCode;
private Builder() {
}
public Builder imo(String imo) {
this.imo = imo;
return this;
}
public Builder mmsi(Optional mmsi) {
this.mmsi = mmsi;
return this;
}
public Builder type2(Optional type2) {
this.type2 = type2;
return this;
}
public Builder type3(Optional type3) {
this.type3 = type3;
return this;
}
public Builder type4(Optional type4) {
this.type4 = type4;
return this;
}
public Builder type5(Optional type5) {
this.type5 = type5;
return this;
}
public Builder grossTonnage(Optional grossTonnage) {
this.grossTonnage = grossTonnage;
return this;
}
public Builder classificationSocietyCode(Optional classificationSocietyCode) {
this.classificationSocietyCode = classificationSocietyCode;
return this;
}
public Builder flagCode(Optional flagCode) {
this.flagCode = flagCode;
return this;
}
public Builder groupBeneficialOwnerCompanyCode(
Optional groupBeneficialOwnerCompanyCode) {
this.groupBeneficialOwnerCompanyCode = groupBeneficialOwnerCompanyCode;
return this;
}
public Builder groupBeneficialOwnerCountryOfDomicileCode(
Optional groupBeneficialOwnerCountryOfDomicileCode) {
this.groupBeneficialOwnerCountryOfDomicileCode = groupBeneficialOwnerCountryOfDomicileCode;
return this;
}
public Builder countryOfBuildCode(Optional countryOfBuildCode) {
this.countryOfBuildCode = countryOfBuildCode;
return this;
}
public Builder yearOfBuild(Optional yearOfBuild) {
this.yearOfBuild = yearOfBuild;
return this;
}
public Builder monthOfBuild(Optional monthOfBuild) {
this.monthOfBuild = monthOfBuild;
return this;
}
public Builder deadweightTonnage(Optional dwt) {
this.deadweightTonnage = dwt;
return this;
}
public Builder statCode5(Optional value) {
this.statCode5 = value;
return this;
}
public Builder lengthOverallMetres(Optional value) {
this.lengthOverallMetres = value;
return this;
}
public Builder breadthMetres(Optional value) {
this.breadthMetres = value;
return this;
}
public Builder displacementTonnage(Optional value) {
this.displacementTonnage = value;
return this;
}
public Builder draughtMetres(Optional value) {
this.draughtMetres = value;
return this;
}
public Builder speedKnots(Optional value) {
this.speedKnots = value;
return this;
}
public Builder lastUpdateTime(Optional value) {
this.lastUpdateTime = value;
return this;
}
public Builder name(Optional name) {
this.name = name;
return this;
}
public Builder shipBuilderCompanyCode(Optional shipBuilderCompanyCode) {
this.shipBuilderCompanyCode = shipBuilderCompanyCode;
return this;
}
public Ship build() {
return new Ship(imo, mmsi, type2, type3, type4, type5, grossTonnage,
classificationSocietyCode, flagCode, groupBeneficialOwnerCompanyCode,
groupBeneficialOwnerCountryOfDomicileCode, countryOfBuildCode, yearOfBuild,
monthOfBuild, deadweightTonnage, statCode5, lengthOverallMetres, breadthMetres,
displacementTonnage, draughtMetres, speedKnots, lastUpdateTime, name,
shipBuilderCompanyCode);
}
}
@Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("Ship [imo=");
b.append(imo);
b.append(", mmsi=");
b.append(mmsi);
b.append(", type2=");
b.append(type2);
b.append(", type3=");
b.append(type3);
b.append(", type4=");
b.append(type4);
b.append(", type5=");
b.append(type5);
b.append(", grossTonnage=");
b.append(grossTonnage);
b.append(", classificationSocietyCode=");
b.append(classificationSocietyCode);
b.append(", flagCode=");
b.append(flagCode);
b.append(", groupBeneficialOwnerCompanyCode=");
b.append(groupBeneficialOwnerCompanyCode);
b.append(", groupBeneficialOwnerCountryOfDomicileCode=");
b.append(groupBeneficialOwnerCountryOfDomicileCode);
b.append(", countryOfBuildCode=");
b.append(countryOfBuildCode);
b.append(", yearOfBuild=");
b.append(yearOfBuild);
b.append(", monthOfBuild=");
b.append(monthOfBuild);
b.append(", deadweightTonnage=");
b.append(deadweightTonnage);
b.append(", statCode5=");
b.append(statCode5);
b.append(", lengthOverallMetres=");
b.append(lengthOverallMetres);
b.append(", breadthMetres=");
b.append(breadthMetres);
b.append(", displacementTonnage=");
b.append(displacementTonnage);
b.append(", draughtMetres=");
b.append(draughtMetres);
b.append(", speedKnots=");
b.append(speedKnots);
b.append(", lastUpdateTime=");
b.append(lastUpdateTime);
b.append(", name=");
b.append(name);
b.append(", shipBuilderCompanyCode=");
b.append(shipBuilderCompanyCode);
b.append("]");
return b.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy