I have a number field in one of my entities. I need to add some logic that this field can only take numbers that are powers of two and if it isn't then an error should be thrown to the user.

I have no idea where to start with this, I'm fairly new to web development. I was thinking I could push in the setters and getters for the number field and add logic there but then how will the appropriate error be thrown?

/confused

Thanks

I have no idea where to start with this, I'm fairly new to web development. I was thinking I could push in the setters and getters for the number field and add logic there but then how will the appropriate error be thrown?

/confused

Thanks

## Comment