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

com.enonic.xp.query.QueryExplanation Maven / Gradle / Ivy

There is a newer version: 7.14.4
Show newest version
package com.enonic.xp.query;

import java.util.ArrayList;

public class QueryExplanation
{
    private final float value;

    private final String description;

    private final ArrayList details;

    private QueryExplanation( final Builder builder )
    {
        value = builder.value;
        description = builder.description;
        details = builder.details;
    }

    public float getValue()
    {
        return value;
    }

    public String getDescription()
    {
        return description;
    }

    public ArrayList getDetails()
    {
        return details;
    }

    public static Builder create()
    {
        return new Builder();
    }

    public static final class Builder
    {
        private float value;

        private String description;

        private final ArrayList details = new ArrayList<>();

        private Builder()
        {
        }

        public Builder value( final float val )
        {
            value = val;
            return this;
        }

        public Builder description( final String val )
        {
            description = val;
            return this;
        }

        public Builder addDetail( final QueryExplanation val )
        {
            details.add( val );
            return this;
        }

        public QueryExplanation build()
        {
            return new QueryExplanation( this );
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy