Skip to content

Instantly share code, notes, and snippets.

@asouza
Created March 26, 2020 23:38
Show Gist options
  • Save asouza/4c5b27d054dcb99c70c3a3f1b8bb4e09 to your computer and use it in GitHub Desktop.
Save asouza/4c5b27d054dcb99c70c3a3f1b8bb4e09 to your computer and use it in GitHub Desktop.
public class CaracteristicaRequest implements CriadorCaracteristica{
new Produto(...., caracteristicasRequest)
}
public Produto(@NotNull Usuario usuario,
@NotNull Categoria categoria,
@NotEmpty String nome,
@Min(value = 1) BigDecimal valor,
@Min(value = 0) int quantidade,
@NotEmpty @Length(max = 1000) String descricao,
@NotEmpty @Min(value = 1) List<String> urlsFotos,
@NotEmpty @Min(value = 1)List<CriadorCaracteristica> caracteristicasProduto) {
for(Carac c : cs){
c.criaCaracteristica(this);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment