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

com.contentgrid.thunx.predicates.model.Variable Maven / Gradle / Ivy

Go to download

Set of (vendor-neutral) data structures to model authorization policy expressions

There is a newer version: 0.11.0
Show newest version
package com.contentgrid.thunx.predicates.model;

import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;

@Getter
@EqualsAndHashCode
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public class Variable implements ThunkExpression {

    @NonNull
    private final String name;

    @Override
    public Class getResultType() {
        return Object.class;
    }

    @Override
    public  R accept(ThunkExpressionVisitor visitor, C context) {
        return visitor.visit(this, context);
    }

    public static Variable named(String name) {
        return new Variable(name);
    }
}