Package com.uca.flights

## Class TripBuilder

- java.lang.Object
- - com.uca.flights.TripBuilder

All Implemented Interfaces:
  `java.lang.Cloneable`

    public class TripBuilder
    extends java.lang.Object
    implements java.lang.Cloneable

Tool to build a trip

### Constructor Summary

Constructors
`TripBuilder()` Constructor
`TripBuilder​(Airport a, java.time.Duration d)` Constructor
`TripBuilder​(Jump j)` Constructor
`TripBuilder​(Step s)` Constructor
`TripBuilder​(Trip trip)` Constructor
`TripBuilder​(TripBuilder tb)` Constructor

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `append​(Airport a, java.time.Duration d)` Add a step to the trip builder
`void` `append​(Jump j)` Add a jump to the trip builder
`void` `append​(Step s)` Add a step to the trip builder
`void` `append​(Trip t)` Add a trip to the trip builder
`void` `append​(TripBuilder tb)` Concatenate the two tripbilder
`void` `clear()` Clear the trip
`java.lang.Object` `clone()` Redefinition of clone
`void` `prepend​(Airport a, java.time.Duration d)` Add a step to the trip builder
`void` `prepend​(Jump j)` Add a jump to the trip builder
`void` `prepend​(Step s)` Add a step to the trip builder
`void` `prepend​(Trip t)` Add a trip to the trip builder
`void` `prepend​(TripBuilder tb)` Concatenate the two tripbilder
`void` `removeFirst()` Remove the first step of the trip
`void` `removeLast()` Remove the last step of the trip
`void` `setAbsoluteDuration​(boolean b)` Setter
`Trip` `toRegularTrip()` Create a regular trip
`Trip` `toTrip()` Create a trip
`void` `updateDuration()` Pass all duration from absolute to relative
`boolean` `useAbsoluteDuration()` Getter

### Methods inherited from class java.lang.Object

`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### TripBuilder

    public TripBuilder()

Constructor

#### TripBuilder

    public TripBuilder​(TripBuilder tb)

Constructor

Parameters:
  `tb` - a tribbuilder
Throws:
  `java.lang.IllegalArgumentException` - on null parameter

#### TripBuilder

    public TripBuilder​(Trip trip)

Constructor

Parameters:
  `trip` - a trip
Throws:
  `java.lang.IllegalArgumentException` - on null parameter

#### TripBuilder

    public TripBuilder​(Jump j)

Constructor

Parameters:
  `j` - a jump
Throws:
  `java.lang.IllegalArgumentException` - on null parameter

#### TripBuilder

    public TripBuilder​(Step s)

Constructor

Parameters:
  `s` - a step
Throws:
  `java.lang.IllegalArgumentException` - on null parameter

#### TripBuilder

    public TripBuilder​(Airport a,
                       java.time.Duration d)

Constructor

Parameters:
  `a` - an airport
  `d` - a duration
Throws:
  `java.lang.IllegalArgumentException` - on null parameter

### Method Detail

#### append

    public void append​(TripBuilder tb)

Concatenate the two tripbilder

Parameters:
  `tb` - a tribbuilder
Throws:
  `java.lang.IllegalArgumentException` - on null or empty parameter

#### prepend

    public void prepend​(TripBuilder tb)

Concatenate the two tripbilder

Parameters:
  `tb` - a tribbuilder
Throws:
  `java.lang.IllegalArgumentException` - on null or empty parameter

#### append

    public void append​(Trip t)

Add a trip to the trip builder

Parameters:
  `t` - a trip
Throws:
  `java.lang.IllegalArgumentException` - on null parameter

#### prepend

    public void prepend​(Trip t)

Add a trip to the trip builder

Parameters:
  `t` - a trip
Throws:
  `java.lang.IllegalArgumentException` - on null parameter

#### append

    public void append​(Jump j)

Add a jump to the trip builder

Parameters:
  `j` - a jump
Throws:
  `java.lang.IllegalArgumentException` - on null parameter

#### prepend

    public void prepend​(Jump j)

Add a jump to the trip builder

Parameters:
  `j` - a jump
Throws:
  `java.lang.IllegalArgumentException` - on null parameter

#### append

    public void append​(Step s)

Add a step to the trip builder

Parameters:
  `s` - a step
Throws:
  `java.lang.IllegalArgumentException` - on null parameter

#### prepend

    public void prepend​(Step s)

Add a step to the trip builder

Parameters:
  `s` - a step
Throws:
  `java.lang.IllegalArgumentException` - on null parameter

#### append

    public void append​(Airport a,
                       java.time.Duration d)

Add a step to the trip builder

Parameters:
  `a` - an airport
  `d` - a duration
Throws:
  `java.lang.IllegalArgumentException` - on null parameter

#### prepend

    public void prepend​(Airport a,
                        java.time.Duration d)

Add a step to the trip builder

Parameters:
  `a` - an airport
  `d` - a duration
Throws:
  `java.lang.IllegalArgumentException` - on null parameter

#### removeLast

    public void removeLast()

Remove the last step of the trip

Throws:
  `java.lang.IllegalArgumentException` - if empty

#### removeFirst

    public void removeFirst()

Remove the first step of the trip

Throws:
  `java.lang.IllegalArgumentException` - if empty

#### clear

    public void clear()

Clear the trip

#### updateDuration

    public void updateDuration()

Pass all duration from absolute to relative

Throws:
  `java.lang.IllegalArgumentException` - if empty

#### toTrip

    public Trip toTrip()

Create a trip

Returns:
  a new trip
Throws:
  `java.lang.IllegalArgumentException` - if empty

#### toRegularTrip

    public Trip toRegularTrip()

Create a regular trip

Returns:
  a new regular trip
Throws:
  `java.lang.IllegalArgumentException` - if empty

#### clone

    public java.lang.Object clone()

Redefinition of clone

Overrides:
  `clone` in class `java.lang.Object`
Returns:
  a deep copy of this

#### useAbsoluteDuration

    public boolean useAbsoluteDuration()

Getter

Returns:
  if absolute duration are used

#### setAbsoluteDuration

    public void setAbsoluteDuration​(boolean b)

Setter

Parameters:
  `b` - a boolean