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

de.team33.patterns.tuple.janus.Quad Maven / Gradle / Ivy

There is a newer version: 1.20.0
Show newest version
package de.team33.patterns.tuple.janus;

import java.util.Arrays;
import java.util.List;

public class Quad extends Tuple {

    private final N north;
    private final E east;
    private final S south;
    private final W west;

    public Quad(final N north, final E east, final S south, final W west) {
        this.north = north;
        this.east = east;
        this.south = south;
        this.west = west;
    }

    public static  Quad of(final L north, final R east, final S south, final W west) {
        return new Quad<>(north, east, south, west);
    }

    public final N north() {
        return north;
    }

    public final E east() {
        return east;
    }

    public final S south() {
        return south;
    }

    public final W west() {
        return west;
    }

    @Override
    public final List toList() {
        return Arrays.asList(north, east, south, west);
    }
}