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

com.flyfish.oauth.domain.data.Tuple Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
package com.flyfish.oauth.domain.data;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 二元组
 */
@AllArgsConstructor(staticName = "of")
public class Tuple {

    @Getter
    private T first;

    @Getter
    private T second;

    private Tuple(T[] args) {
        this.first = args[0];
        this.second = args[1];
    }

    @SuppressWarnings("unchecked")
    private Tuple(String pattern) {
        this((T[]) pattern.split(" -> "));
    }

    public static Tuple parse(String pattern) {
        return new Tuple<>(pattern);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy