Page Enum with overridden methods for the first and last members
Interesting question. Overriding methods in enum instances is not something I have encountered (that I recall). This is not to say it's a bad thing, just not very common. (P.S. having just claimed not to have encountered enum overrides, I see it is used in this answer given shortly before you asked this very question

The concept is something I have solved using different mechanisms before, but I can understand why having the override makes sense to you.

What I don't understand is why you did not just use a regular bound-clipping system. Why do you need the overrides at all?

Consider these methods:

  public Page next() {
    if (ordinal() == values().length - 1) {
        return this;
    }
    return values()[ordinal() + 1];
  }

  public Page previous() {
    if (ordinal() == 0) {
        return this;
    }
    return values()[ordinal() - 1];
  }


There is no reason to override them at all.

On the other hand, if you do override them, then please use a standard indentation for the override methods. Cramming it all on one line is not helpful:


public enum Page {
    INTRO {
        @Override
        public Page previous() {
            return this;
        }
    },
    PUBLIC_PROFILE,
    PRIVATE_PROFILE,
    SOCIAL_ACCOUNTS,
    LOOPS,
    INVITE,
    FINISHED {
        @Override
        public Page next() {
            return this;
        };
    };