package org.bitstrings.maven.plugins.portallocator;

import java.util.LinkedList;
import java.util.List;

public class PortAllocator
{
    public static class PreferredPorts
    {
        private final List<String> portsList = new LinkedList<>();

        public void addPorts( String ports )
        {
            portsList.add( ports );
        }

        public void set( String ports )
        {
            portsList.add( ports );
        }

        public List<String> getPortsList()
        {
            return portsList;
        }
    }

    public static enum DepletedAction
    {
        CONTINUE, FAIL;
    }

    private String id;
    private PreferredPorts preferredPorts;
    private DepletedAction depletedAction;
    private boolean permitOverride;

    public String getId()
    {
        return id;
    }

    public void setId( String id )
    {
        this.id = id;
    }

    public PreferredPorts getPreferredPorts()
    {
        return preferredPorts;
    }

    public void setPreferredPorts( PreferredPorts preferredPorts )
    {
        this.preferredPorts = preferredPorts;
    }

    public DepletedAction getDepletedAction()
    {
        return depletedAction;
    }

    public void setDepletedAction( DepletedAction depletedAction )
    {
        this.depletedAction = depletedAction;
    }

    public boolean isPermitOverride()
    {
        return permitOverride;
    }

    public void setPermitOverride( boolean permitOverride )
    {
        this.permitOverride = permitOverride;
    }
}

@@ -1520,11 +1520,241 @@
 e;%0A    %7D
+%0A%0A    public void set( String preferredPortsStr )%0A    %7B%0A        final PreferredPorts preferredPorts = new PreferredPorts();%0A%0A        preferredPorts.addPorts( preferredPortsStr );%0A%0A        setPreferredPorts( preferredPorts );%0A    %7D
 %0A%7D%0A

add short form