glaforge/gaelyk — Issue #91: Pogo Entity Enum Coercion Support
Author: codeconsole
Created: 2011-11-19 02:24:04+00:00
State: open

@Canonical
class Match {
MatchOutcome outcome
}

public enum MatchOutcome {
WIN, DRAW, LOSE
}

Entity e = new Entity('Match')
e.outcome = 'WIN'
Match m = e as Match
assert m.outcome == MatchOutcome.WIN // succeeds
Entity e2 = m as Entity // fails - java.lang.IllegalArgumentException: outcome: MatchOutcome is not a supported property type.