@Test public void testConvert_02() { BuildState state = WebHookBuildStateConverter.convert(Integer.parseInt("11111011",2)); assertTrue(state.allEnabled()); }
public static BuildState convert(Integer oldState){ BuildState newStates = new BuildState(); newStates.setEnabled(BuildStateEnum.CHANGES_LOADED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_ADDED_TO_QUEUE, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_REMOVED_FROM_QUEUE, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_STARTED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BEFORE_BUILD_FINISHED, OldStyleBuildState.enabled(OldStyleBuildState.BEFORE_BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_INTERRUPTED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_INTERRUPTED, oldState)); newStates.setEnabled(BuildStateEnum.RESPONSIBILITY_CHANGED, OldStyleBuildState.enabled(OldStyleBuildState.RESPONSIBILITY_CHANGED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_FINISHED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_SUCCESSFUL, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_FAILED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_PINNED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_UNPINNED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); return newStates; }
WebHookBuildStateConverter { public static BuildState convert(Integer oldState){ BuildState newStates = new BuildState(); newStates.setEnabled(BuildStateEnum.CHANGES_LOADED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_ADDED_TO_QUEUE, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_REMOVED_FROM_QUEUE, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_STARTED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BEFORE_BUILD_FINISHED, OldStyleBuildState.enabled(OldStyleBuildState.BEFORE_BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_INTERRUPTED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_INTERRUPTED, oldState)); newStates.setEnabled(BuildStateEnum.RESPONSIBILITY_CHANGED, OldStyleBuildState.enabled(OldStyleBuildState.RESPONSIBILITY_CHANGED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_FINISHED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_SUCCESSFUL, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_FAILED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_PINNED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_UNPINNED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); return newStates; } }
WebHookBuildStateConverter { public static BuildState convert(Integer oldState){ BuildState newStates = new BuildState(); newStates.setEnabled(BuildStateEnum.CHANGES_LOADED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_ADDED_TO_QUEUE, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_REMOVED_FROM_QUEUE, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_STARTED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BEFORE_BUILD_FINISHED, OldStyleBuildState.enabled(OldStyleBuildState.BEFORE_BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_INTERRUPTED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_INTERRUPTED, oldState)); newStates.setEnabled(BuildStateEnum.RESPONSIBILITY_CHANGED, OldStyleBuildState.enabled(OldStyleBuildState.RESPONSIBILITY_CHANGED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_FINISHED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_SUCCESSFUL, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_FAILED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_PINNED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_UNPINNED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); return newStates; } private  WebHookBuildStateConverter(); }
WebHookBuildStateConverter { public static BuildState convert(Integer oldState){ BuildState newStates = new BuildState(); newStates.setEnabled(BuildStateEnum.CHANGES_LOADED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_ADDED_TO_QUEUE, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_REMOVED_FROM_QUEUE, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_STARTED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BEFORE_BUILD_FINISHED, OldStyleBuildState.enabled(OldStyleBuildState.BEFORE_BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_INTERRUPTED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_INTERRUPTED, oldState)); newStates.setEnabled(BuildStateEnum.RESPONSIBILITY_CHANGED, OldStyleBuildState.enabled(OldStyleBuildState.RESPONSIBILITY_CHANGED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_FINISHED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_SUCCESSFUL, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_FAILED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_PINNED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_UNPINNED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); return newStates; } private  WebHookBuildStateConverter(); static BuildState convert(Integer oldState); }
WebHookBuildStateConverter { public static BuildState convert(Integer oldState){ BuildState newStates = new BuildState(); newStates.setEnabled(BuildStateEnum.CHANGES_LOADED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_ADDED_TO_QUEUE, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_REMOVED_FROM_QUEUE, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_STARTED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_STARTED, oldState)); newStates.setEnabled(BuildStateEnum.BEFORE_BUILD_FINISHED, OldStyleBuildState.enabled(OldStyleBuildState.BEFORE_BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_INTERRUPTED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_INTERRUPTED, oldState)); newStates.setEnabled(BuildStateEnum.RESPONSIBILITY_CHANGED, OldStyleBuildState.enabled(OldStyleBuildState.RESPONSIBILITY_CHANGED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_FINISHED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_SUCCESSFUL, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_FAILED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_PINNED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); newStates.setEnabled(BuildStateEnum.BUILD_UNPINNED, OldStyleBuildState.enabled(OldStyleBuildState.BUILD_FINISHED, oldState)); return newStates; } private  WebHookBuildStateConverter(); static BuildState convert(Integer oldState);  }