<commit_before>package siren;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * An embedded entity representation that contains all the characteristics of a typical entity.
 * One difference is that a sub-entity MUST contain a rel attribute to describe its relationship to the parent entity.
 * @author jonfreer
 * @since 8/13/17
 */
public class EmbeddedRepresentationSubEntity extends Entity {

    /**
     * Constructs an instance of {@link EmbeddedRepresentationSubEntity.Builder}.
     */
    public static class Builder implements siren.Builder<EmbeddedRepresentationSubEntity>{

        private List<String> rel;
        private List<String> klass;
        private Map<String, Object> properties;
        private List<Action> actions;
        private List<Link> links;
        private List<EntityBase> subEntities;
        private String title;

        /**
         * Constructs an instance of {@link EmbeddedRepresentationSubEntity.Builder}.
         */
        public Builder(){}

        /**
         * Adds the class provided to the current state of the builder.
         * @param klass Describes the nature of an entity's content based on the current representation.
         *                  Possible values are implementation-dependent and should be documented.
         * @return The builder this method is called on.
         */
        public Builder klass(String klass){
            if(klass == null){
                throw new IllegalArgumentException("'klass' cannot be null.");
            }
            if(this.klass == null) {
                this.klass = new ArrayList<String>();
            }
            this.klass.add(klass);
            return this;
        }

        /**
         * Adds the property provided to the current state of the builder.
         * @param propertyKey The key portion of a key-value pair that describes the state of an entity.
         * @param propertyValue The value portion of a key-value pair that describes the state of an entity.
         * @param <T> The type of the value portion of a key-value pair that describes the state of an entity.
         * @return The builder this method is called on.
         */
        public <T> Builder property(String propertyKey, T propertyValue){
            if(this.properties == null){
                this.properties = new HashMap<String, Object>();
            }
            this.properties.put(propertyKey, propertyValue);
            return this;
        }

        /**
         * Adds the properties provided to the current state of the builder.
         * @param properties A set of key-value pairs that describe the state of an entity.
         * @return The builder this method is called on.
         */
        public Builder properties(Map<String, Object> properties){
            if(this.properties == null){
                this.properties = new HashMap<String, Object>();
            }
            this.properties.putAll(properties);
            return this;
        }

        /**
         * Adds the action provided to the current state of the builder.
         * @param action An action showing an available behavior an entity exposes.
         * @return The builder this method is called on.
         */
        public Builder action(Action action){
            if(this.actions == null){
                this.actions = new ArrayList<Action>();
            }
            this.actions.add(action);
            return this;
        }

        /**
         * Adds the actions provided to the current state of the builder.
         * @param actions Actions showing available behaviors an entity exposes.
         * @return The builder this method is called on.
         */
        public Builder actions(List<Action> actions){
            if(this.actions == null){
                this.actions = new ArrayList<>();
            }
            this.actions.addAll(actions);
            return this;
        }

        /**
         * Adds the link provided to the current state of the builder.
         * @param link A navigational link, distinct from an entity relationship.<commit_msg>Remove plural form of EmbeddedRepresentationSubEntity.Builder methods.<commit_after>package siren;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * An embedded entity representation that contains all the characteristics of a typical entity.
 * One difference is that a sub-entity MUST contain a rel attribute to describe its relationship to the parent entity.
 * @author jonfreer
 * @since 8/13/17
 */
public class EmbeddedRepresentationSubEntity extends Entity {

    /**
     * Constructs an instance of {@link EmbeddedRepresentationSubEntity.Builder}.
     */
    public static class Builder implements siren.Builder<EmbeddedRepresentationSubEntity>{

        private List<String> rel;
        private List<String> klass;
        private Map<String, Object> properties;
        private List<Action> actions;
        private List<Link> links;
        private List<EntityBase> subEntities;
        private String title;

        /**
         * Constructs an instance of {@link EmbeddedRepresentationSubEntity.Builder}.
         */
        public Builder(){}

        /**
         * Adds the class provided to the current state of the builder.
         * @param klass Describes the nature of an entity's content based on the current representation.
         *                  Possible values are implementation-dependent and should be documented.
         * @return The builder this method is called on.
         */
        public Builder klass(String klass){
            if(klass == null){
                throw new IllegalArgumentException("'klass' cannot be null.");
            }
            if(this.klass == null) {
                this.klass = new ArrayList<String>();
            }
            this.klass.add(klass);
            return this;
        }

        /**
         * Adds the property provided to the current state of the builder.
         * @param propertyKey The key portion of a key-value pair that describes the state of an entity.
         * @param propertyValue The value portion of a key-value pair that describes the state of an entity.
         * @param <T> The type of the value portion of a key-value pair that describes the state of an entity.
         * @return The builder this method is called on.
         */
        public <T> Builder property(String propertyKey, T propertyValue){
            if(propertyKey == null){
                throw new IllegalArgumentException("'propertyKey' cannot be null.");
            }
            if(this.properties == null){
                this.properties = new HashMap<String, Object>();
            }
            this.properties.put(propertyKey, propertyValue);
            return this;
        }

        /**
         * Adds the action provided to the current state of the builder.
         * @param action An action showing an available behavior an entity exposes.
         * @return The builder this method is called on.
         */
        public Builder action(Action action){
            if(this.actions == null){
                this.actions = new ArrayList<Action>();
            }
            this.actions.add(action);
            return this;
        }

        /**
         * Adds the link provided to the current state of the builder.
         * @param link A navigational link, distinct from an entity relationship.
{'fraction_non_alphanumeric': 0.07599148256587702, 'fraction_numerical': 0.0013308490817141336, 'mean_word_length': 2.0437424058323206, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4226812', 'n_tokens_mistral': 1756, 'n_tokens_neox': 1730, 'n_words': 710}