java - "unexpected type" error when comparing enum values -


With this problem I have seen that most people were using = where they = = . What's my problem here?

 com \ callmeyer \ jopp \ FieldCoordinator.java: 303: Unexpected type required: class, package found: variable if (event.getType () == event.Type.INSERT) {^  

enum definition and access:

  public class DataLayoutEvent {public static enum type {INSERT, DELETE, RENAME, MOVE, RESIZE} Private type type = faucet; Public type getType () {return type; } ...}   

and the method where the error occurs:

  changed the public zero layout (DataLayoutEvent event) {if (event.getType () = = Event.Type.INSERT) {fieldAdded (event.getField), event.getToIndex ()); } ...    

Use stationary access instead of example:

  if (event.getType () == DataLayoutEvent.Type.INSERT) {  

You can not use instance access for static member (methods and fields ), But not for the internal type.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -