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

de.alexanderwodarz.code.model.varible.VaribleMap Maven / Gradle / Ivy

There is a newer version: 1.4.5
Show newest version
package de.alexanderwodarz.code.model.varible;

import java.util.ArrayList;

public class VaribleMap {

    private ArrayList varibles = new ArrayList<>();

    public VaribleMap put(Varible varible) {
        this.varibles.add(varible);
        return this;
    }

    public VaribleMap put(String key, Object value){
        return new VaribleBuilder(this).setKey(key).setValue(value).build();
    }

    public VaribleBuilder put() {
        return new VaribleBuilder(this);
    }

    public Varible search(String key) {
        return this.varibles.stream().filter(k -> k.getKey().equalsIgnoreCase(key)).findFirst().orElse(null);
    }

    public void remove(String key) {
        Varible varible = search(key);
        if (varible == null)
            return;
        this.varibles.remove(varible);
    }

    public ArrayList getVaribles() {
        return varibles;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy