io.vlingo.actors.Protocols Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vlingo-actors Show documentation
Show all versions of vlingo-actors Show documentation
Type safe Actor Model toolkit for reactive concurrency and resiliency using Java and other JVM languages.
// Copyright © 2012-2020 VLINGO LABS. All rights reserved.
//
// This Source Code Form is subject to the terms of the
// Mozilla Public License, v. 2.0. If a copy of the MPL
// was not distributed with this file, You can obtain
// one at https://mozilla.org/MPL/2.0/.
package io.vlingo.actors;
public class Protocols {
private final Object[] protocolActors;
@SuppressWarnings("unchecked")
public T get(final int index) {
return (T) protocolActors[index];
}
Protocols(final Object[] protocolActors) {
this.protocolActors = protocolActors;
}
public static Two two(final Protocols protocols) {
return new Two(protocols);
}
public static class Two {
public final A _1;
public final B _2;
public Two(final Protocols protocols) {
this._1 = protocols.get(0);
this._2 = protocols.get(1);
}
}
public static Three three(final Protocols protocols) {
return new Three(protocols);
}
public static class Three {
public final A _1;
public final B _2;
public final C _3;
public Three(final Protocols protocols) {
this._1 = protocols.get(0);
this._2 = protocols.get(1);
this._3 = protocols.get(2);
}
}
public static Four four(final Protocols protocols) {
return new Four(protocols);
}
public static class Four {
public final A _1;
public final B _2;
public final C _3;
public final D _4;
public Four(final Protocols protocols) {
this._1 = protocols.get(0);
this._2 = protocols.get(1);
this._3 = protocols.get(2);
this._4 = protocols.get(3);
}
}
public static Five five(final Protocols protocols) {
return new Five(protocols);
}
public static class Five {
public final A _1;
public final B _2;
public final C _3;
public final D _4;
public final E _5;
public Five(final Protocols protocols) {
this._1 = protocols.get(0);
this._2 = protocols.get(1);
this._3 = protocols.get(2);
this._4 = protocols.get(3);
this._5 = protocols.get(4);
}
}
}