Questions tagged as 'enums'

1
answer

Using enums in java

I created an enum and need to set the values in the database in this way: If it is Revenue, the value is 0; If Expense, the value is 1; This is my Enum: public enum EntryType { INCOME, OUTPUT; } In my java controller, the type...
asked by 21.02.2017 / 01:05
1
answer

calling Enum by value [duplicate]

I created an enum: public enum EnumTipoBoleto { VazioErro=0, ConfigInicial = 1, Mensalidade = 2, Outros =3, DifMensal =4 } Now in some places I have the number and want to convert to enum...
asked by 30.09.2016 / 15:23
1
answer

Select sex with enum

I made the select gender field this way: model: enum sexo: [:feminino, :masculino, :desconhecido] def self.sexes_for_select sexos.keys.map{ |x| [x.humanize, x] } end form: <%= f.select :sexo, Pessoa.sexes_for_sele...
asked by 19.10.2016 / 17:32
3
answers

Compare an integer entered with each enum value

Hello. I want to check if the option that the user entered matches an option in the menu. I am using enum to show the options and the user types a corresponding number. But I can not. Let's look at the menu enum and the class I'm testing. p...
asked by 19.05.2016 / 18:38
1
answer

Random of Enumerator

I'm not able to do a random enumerator. enum Notas {A=10, B=22, C=31, D=44, E=56}; It has this solution, but I need the enumerator values and here it is returning the rest of the calculation. enum Notas {A=10, B=22, C=31, D=44, E=56, ULTI...
asked by 09.03.2016 / 18:00
0
answers

Function with enum - TYPESCRIPT

I need to put a function into an enum in typescript as in the example below: export enum dataTableFunc{ 'edit'= teste() } function teste(event.button){ // } In this function that I am trying to pass to the enum still must receive one...
asked by 22.03.2018 / 22:30
3
answers

Spring MVC Enum

I would like a help, I'm new to Spring MVC and I'm trying to send a numeral value of an Enum that I have in my class, but I'm not getting it, only the Nominal value is accepted. I would like some help. Thanks Example: public enum TipoCli...
asked by 24.03.2016 / 00:09
1
answer

How to get enum string in an ASP.MVC grid

I have the following enum: public enum RegiaoEnum { CENTRO = 1, NORTE = 2, SUL = 3, SUDESTE = 4, CENTROOESTE = 5 } And the following View: @using MeuDominio.Enums; <div class="animate"> <table ng-table="vm....
asked by 08.06.2018 / 15:24
2
answers

Enum getting next code in Java

I have a class in java that one of its attributes is an enum and has the following values: HIPERTROFIA(1, "Hipertrofia"), DEFINICAO(2, "Definição"), RESISTENCIA(3, "Resistência"), OUTROS(4, "Outros"); When I send the value 0...
asked by 29.03.2018 / 15:59
1
answer

could not convert | Error while returning object

The purpose of the code below is to return the tokens of a given expression, for example: 50 + 30 * (30-10) + (10/2) . Where tokens would be: [number, 50], [sum, +], [number, 30], [mult, *], and so on. However, when you try to return the T...
asked by 21.09.2017 / 03:23