@Test public void getValue_returnsDefaultIfUndefined() throws Exception { OrientationOptions options = new OrientationOptions(); assertThat(options.getValue()).isEqualTo(Orientation.Default.orientationCode); }
public int getValue() { if (!hasValue()) return Orientation.Default.orientationCode; switch (orientations.get(0)) { case Landscape: return orientations.contains(Orientation.Portrait) ? Orientation.PortraitLandscape.orientationCode : Orientation.Landscape.orientationCode; case Portrait: return orientations.contains(Orientation.Landscape) ? Orientation.PortraitLandscape.orientationCode : Orientation.Portrait.orientationCode; case SensorLandscape: return Orientation.SensorLandscape.orientationCode; default: case Default: return Orientation.Default.orientationCode; } }
OrientationOptions { public int getValue() { if (!hasValue()) return Orientation.Default.orientationCode; switch (orientations.get(0)) { case Landscape: return orientations.contains(Orientation.Portrait) ? Orientation.PortraitLandscape.orientationCode : Orientation.Landscape.orientationCode; case Portrait: return orientations.contains(Orientation.Landscape) ? Orientation.PortraitLandscape.orientationCode : Orientation.Portrait.orientationCode; case SensorLandscape: return Orientation.SensorLandscape.orientationCode; default: case Default: return Orientation.Default.orientationCode; } } }
OrientationOptions { public int getValue() { if (!hasValue()) return Orientation.Default.orientationCode; switch (orientations.get(0)) { case Landscape: return orientations.contains(Orientation.Portrait) ? Orientation.PortraitLandscape.orientationCode : Orientation.Landscape.orientationCode; case Portrait: return orientations.contains(Orientation.Landscape) ? Orientation.PortraitLandscape.orientationCode : Orientation.Portrait.orientationCode; case SensorLandscape: return Orientation.SensorLandscape.orientationCode; default: case Default: return Orientation.Default.orientationCode; } }  }
OrientationOptions { public int getValue() { if (!hasValue()) return Orientation.Default.orientationCode; switch (orientations.get(0)) { case Landscape: return orientations.contains(Orientation.Portrait) ? Orientation.PortraitLandscape.orientationCode : Orientation.Landscape.orientationCode; case Portrait: return orientations.contains(Orientation.Landscape) ? Orientation.PortraitLandscape.orientationCode : Orientation.Portrait.orientationCode; case SensorLandscape: return Orientation.SensorLandscape.orientationCode; default: case Default: return Orientation.Default.orientationCode; } }  static OrientationOptions parse(JSONObject json); int getValue(); boolean hasValue(); @CheckResult OrientationOptions copy(); OrientationOptions mergeWithDefault(OrientationOptions defaultOptions); @Override String toString(); }
OrientationOptions { public int getValue() { if (!hasValue()) return Orientation.Default.orientationCode; switch (orientations.get(0)) { case Landscape: return orientations.contains(Orientation.Portrait) ? Orientation.PortraitLandscape.orientationCode : Orientation.Landscape.orientationCode; case Portrait: return orientations.contains(Orientation.Landscape) ? Orientation.PortraitLandscape.orientationCode : Orientation.Portrait.orientationCode; case SensorLandscape: return Orientation.SensorLandscape.orientationCode; default: case Default: return Orientation.Default.orientationCode; } }  static OrientationOptions parse(JSONObject json); int getValue(); boolean hasValue(); @CheckResult OrientationOptions copy(); OrientationOptions mergeWithDefault(OrientationOptions defaultOptions); @Override String toString();  }