Skip to content

Commit

Permalink
Add accepted configuration parameter values API (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
malteo authored Jun 15, 2020
1 parent 60492fb commit 6f19200
Showing 1 changed file with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Map;
import java.util.Objects;

import static com.cloudesire.platform.apiclient.dto.model.constants.ErrorKeys.INVALID_SIZE;
Expand All @@ -29,6 +30,9 @@ public class ConfigurationParameterDTO extends NamedEntityDTO
@RegExp
private String validation;

@ApiModelProperty( "Possible labeled values for the parameter" )
private Map<String, String> acceptedValues;

@ApiModelProperty( "Short description to help user compiling the correct value" )
private String hint;

Expand All @@ -43,8 +47,19 @@ public class ConfigurationParameterDTO extends NamedEntityDTO

public ConfigurationParameterDTO( String name, String code, String description )
{
super( name );
this( name, description );
this.code = code;
}

public ConfigurationParameterDTO( String name, Map<String, String> acceptedValues, String description )
{
this( name, description );
this.acceptedValues = acceptedValues;
}

private ConfigurationParameterDTO( String name, String description )
{
super( name );
this.description = description;
}

Expand Down Expand Up @@ -85,6 +100,17 @@ public ConfigurationParameterDTO setValidation( String validation )
return this;
}

public Map<String, String> getAcceptedValues()
{
return acceptedValues;
}

public ConfigurationParameterDTO setAcceptedValues( Map<String, String> acceptedValues )
{
this.acceptedValues = acceptedValues;
return this;
}

public String getHint()
{
return hint;
Expand Down

0 comments on commit 6f19200

Please sign in to comment.