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 -

ruby on rails - Convert a Activerecord result with has_one associations into a single hash per record -

c# - Confused over DLL entry points (entry point not found exception) -