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

io.linguarobot.aws.cdk.maven.text.table.Cell Maven / Gradle / Ivy

Go to download

The AWS CDK Maven plugin produces and deploys CloudFormation templates based on the cloud infrastructure defined by means of CDK. The goal of the project is to improve the experience of Java developers while working with CDK by eliminating the need for installing Node.js and interacting with the CDK application by means of CDK Toolkit.

There is a newer version: 0.0.8
Show newest version
package io.linguarobot.aws.cdk.maven.text.table;

import com.google.common.collect.ImmutableList;
import io.linguarobot.aws.cdk.maven.text.Ansi;

import javax.annotation.Nullable;
import java.util.List;
import java.util.Optional;

public class Cell {

    private static final Cell BLANK_CELL = new Cell("", null, ImmutableList.of());

    private final String value;
    private final Alignment alignment;
    private final List ansiParameters;

    protected Cell(String value, @Nullable Alignment alignment, List ansiParameters) {
        this.value = value;
        this.alignment = alignment;
        this.ansiParameters = ansiParameters;
    }

    public String getValue() {
        return value;
    }

    public Optional getAlignment() {
        return Optional.ofNullable(alignment);
    }

    public List getAnsiParameters() {
        return ansiParameters;
    }

    @Override
    public String toString() {
        return "Cell{" +
                "value='" + value + '\'' +
                ", alignment=" + alignment +
                ", ansiParameters=" + ansiParameters +
                '}';
    }


    public static Cell of(String value, Ansi.Parameter... parameters) {
        return of(value, null, parameters);
    }

    public static Cell of(String value, @Nullable Alignment alignment, Ansi.Parameter... parameters) {
        return new Cell(value, alignment, ImmutableList.copyOf(parameters));
    }

    public static Cell blank() {
        return BLANK_CELL;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy