com.anaptecs.spring.base.BookingID Maven / Gradle / Ivy
/*
* anaptecs GmbH, Ricarda-Huch-Str. 71, 72760 Reutlingen, Germany
*
* Copyright 2004 - 2019. All rights reserved.
*/
package com.anaptecs.spring.base;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class BookingID {
/**
* Constant for the name of attribute "publicBookingID".
*/
public static final String PUBLICBOOKINGID = "publicBookingID";
/**
* Constant for the name of attribute "referenceID".
*/
public static final String REFERENCEID = "referenceID";
/**
* Constant for the name of attribute "externalRefID".
*/
public static final String EXTERNALREFID = "externalRefID";
/**
* Constant for the name of attribute "inventory".
*/
public static final String INVENTORY = "inventory";
/**
* Constant for the name of attribute "bookingCode".
*/
public static final String BOOKINGCODE = "bookingCode";
/**
*
* Default Value: 42
*/
public static final int MAGIC = 42;
private final transient String publicBookingID;
private final String referenceID;
private final String externalRefID;
private final InventoryType inventory;
private final BookingCode bookingCode;
/**
* Default constructor is only intended to be used for deserialization by tools like Jackson for JSON. For "normal"
* object creation builder should be used instead.
*/
protected BookingID( ) {
publicBookingID = null;
referenceID = null;
externalRefID = null;
inventory = null;
bookingCode = null;
}
/**
* Initialize object using the passed builder.
*
* @param pBuilder Builder that should be used to initialize this object. The parameter must not be null.
*/
protected BookingID( Builder pBuilder ) {
// Read attribute values from builder.
publicBookingID = pBuilder.publicBookingID;
referenceID = pBuilder.referenceID;
externalRefID = pBuilder.externalRefID;
inventory = pBuilder.inventory;
bookingCode = pBuilder.bookingCode;
}
/**
* Method returns a new builder.
*
* @return {@link Builder} New builder that can be used to create new BookingID objects.
*/
public static Builder builder( ) {
return new Builder();
}
/**
* Method converts the passed {@link String} into an instance of this object.
*
* Please be aware that this method is only intended to be used for deserialization frameworks like JAX-RS. For
* "normal" object creation builder should be used instead.
*
* @param pPublicBookingID String that should be used to create an instance of this class. The parameter must not be
* null.
* @return {@link BookingID} Instance of the class that matches to the passed string. The method never returns null.
*/
public static BookingID valueOf( String pPublicBookingID ) {
return builder().setPublicBookingID(String.valueOf(pPublicBookingID)).build();
}
/**
* Class implements builder to create a new instance of class BookingID
.
*/
public static class Builder {
private String publicBookingID;
private String referenceID;
private String externalRefID;
private InventoryType inventory;
private BookingCode bookingCode;
/**
* Use {@link BookingID#builder()} instead of private constructor to create new builder.
*/
protected Builder( ) {
}
/**
* Use {@link BookingID#builder(BookingID)} instead of private constructor to create new builder.
*/
protected Builder( BookingID pObject ) {
if (pObject != null) {
// Read attribute values from passed object.
this.setPublicBookingID(pObject.publicBookingID);
this.setReferenceID(pObject.referenceID);
this.setExternalRefID(pObject.externalRefID);
this.setInventory(pObject.inventory);
this.setBookingCode(pObject.bookingCode);
}
}
/**
* Method sets attribute {@link #publicBookingID}.
*
* @param pPublicBookingID Value to which {@link #publicBookingID} should be set.
* @return {@link Builder} Instance of this builder to support chaining setters. Method never returns null.
*/
public Builder setPublicBookingID( String pPublicBookingID ) {
// Assign value to attribute
publicBookingID = pPublicBookingID;
return this;
}
/**
* Method sets attribute {@link #referenceID}.
*
* @param pReferenceID Value to which {@link #referenceID} should be set.
* @return {@link Builder} Instance of this builder to support chaining setters. Method never returns null.
*/
public Builder setReferenceID( String pReferenceID ) {
// Assign value to attribute
referenceID = pReferenceID;
return this;
}
/**
* Method sets attribute {@link #externalRefID}.
*
* @param pExternalRefID Value to which {@link #externalRefID} should be set.
* @return {@link Builder} Instance of this builder to support chaining setters. Method never returns null.
*/
public Builder setExternalRefID( String pExternalRefID ) {
// Assign value to attribute
externalRefID = pExternalRefID;
return this;
}
/**
* Method sets association {@link #inventory}.
*
* @param pInventory Value to which {@link #inventory} should be set.
* @return {@link Builder} Instance of this builder to support chaining setters. Method never returns null.
*/
public Builder setInventory( InventoryType pInventory ) {
inventory = pInventory;
return this;
}
/**
* Method sets association {@link #bookingCode}.
*
* @param pBookingCode Value to which {@link #bookingCode} should be set.
* @return {@link Builder} Instance of this builder to support chaining setters. Method never returns null.
*/
public Builder setBookingCode( BookingCode pBookingCode ) {
bookingCode = pBookingCode;
return this;
}
/**
* Method creates a new instance of class BookingID. The object will be initialized with the values of the builder.
*
* @return BookingID Created object. The method never returns null.
*/
public BookingID build( ) {
return new BookingID(this);
}
}
/**
* Method returns attribute {@link #publicBookingID}.
*
* @return {@link String} Value to which {@link #publicBookingID} is set.
*/
public String getPublicBookingID( ) {
return publicBookingID;
}
/**
* Method returns attribute {@link #referenceID}.
*
* @return {@link String} Value to which {@link #referenceID} is set.
*/
public String getReferenceID( ) {
return referenceID;
}
/**
* Method returns attribute {@link #externalRefID}.
*
* @return {@link String} Value to which {@link #externalRefID} is set.
*/
public String getExternalRefID( ) {
return externalRefID;
}
/**
* Method returns association {@link #inventory}.
*
* @return {@link InventoryType} Value to which {@link #inventory} is set.
*/
public InventoryType getInventory( ) {
return inventory;
}
/**
* Method returns association {@link #bookingCode}.
*
* @return {@link BookingCode} Value to which {@link #bookingCode} is set.
*/
public BookingCode getBookingCode( ) {
return bookingCode;
}
/**
* Method returns a StringBuilder that can be used to create a String representation of this object. The returned
* StringBuilder also takes care about attributes of super classes.
*
* @return {@link StringBuilder} StringBuilder representing this object. The method never returns null.
*/
public StringBuilder toStringBuilder( String pIndent ) {
StringBuilder lBuilder = new StringBuilder();
lBuilder.append(pIndent);
lBuilder.append(this.getClass().getName());
lBuilder.append(System.lineSeparator());
lBuilder.append(pIndent);
lBuilder.append("publicBookingID: ");
lBuilder.append(publicBookingID);
lBuilder.append(System.lineSeparator());
lBuilder.append(pIndent);
lBuilder.append("referenceID: ");
lBuilder.append(referenceID);
lBuilder.append(System.lineSeparator());
lBuilder.append(pIndent);
lBuilder.append("externalRefID: ");
lBuilder.append(externalRefID);
lBuilder.append(System.lineSeparator());
lBuilder.append(pIndent);
lBuilder.append("inventory: ");
lBuilder.append(inventory);
lBuilder.append(System.lineSeparator());
lBuilder.append(pIndent);
lBuilder.append("bookingCode: ");
if (bookingCode != null) {
lBuilder.append(System.lineSeparator());
lBuilder.append(bookingCode.toStringBuilder(pIndent + " "));
}
else {
lBuilder.append(" null");
lBuilder.append(System.lineSeparator());
}
return lBuilder;
}
/**
* Method creates a new String with the values of all attributes of this class. All references to other objects will
* be ignored.
*
* @return {@link String} String representation of this object. The method never returns null.
*/
@Override
public String toString( ) {
return this.toStringBuilder("").toString();
}
/**
* Method creates a new builder and initializes it with the data of this object.
*
* @return {@link Builder} New builder that can be used to create new BookingID objects. The method never returns
* null.
*/
public Builder toBuilder( ) {
return new Builder(this);
}
}