@Test public void testToNova() { assertThat(converter.toNova(EnumFacing.DOWN)).isEqualTo(Direction.DOWN); assertThat(converter.toNova(EnumFacing.UP)).isEqualTo(Direction.UP); assertThat(converter.toNova(EnumFacing.NORTH)).isEqualTo(Direction.NORTH); assertThat(converter.toNova(EnumFacing.SOUTH)).isEqualTo(Direction.SOUTH); assertThat(converter.toNova(EnumFacing.WEST)).isEqualTo(Direction.WEST); assertThat(converter.toNova(EnumFacing.EAST)).isEqualTo(Direction.EAST); assertThat(converter.toNova(null)).isEqualTo(Direction.UNKNOWN); }
@Override public Direction toNova(@Nullable EnumFacing facing) { if (null == facing) return Direction.UNKNOWN; else switch (facing) { case DOWN: return Direction.DOWN; case UP: return Direction.UP; case NORTH: return Direction.NORTH; case SOUTH: return Direction.SOUTH; case WEST: return Direction.WEST; case EAST: return Direction.EAST; default: return Direction.UNKNOWN; } }
DirectionConverter implements NativeConverter<Direction, EnumFacing> { @Override public Direction toNova(@Nullable EnumFacing facing) { if (null == facing) return Direction.UNKNOWN; else switch (facing) { case DOWN: return Direction.DOWN; case UP: return Direction.UP; case NORTH: return Direction.NORTH; case SOUTH: return Direction.SOUTH; case WEST: return Direction.WEST; case EAST: return Direction.EAST; default: return Direction.UNKNOWN; } } }
DirectionConverter implements NativeConverter<Direction, EnumFacing> { @Override public Direction toNova(@Nullable EnumFacing facing) { if (null == facing) return Direction.UNKNOWN; else switch (facing) { case DOWN: return Direction.DOWN; case UP: return Direction.UP; case NORTH: return Direction.NORTH; case SOUTH: return Direction.SOUTH; case WEST: return Direction.WEST; case EAST: return Direction.EAST; default: return Direction.UNKNOWN; } }  }
DirectionConverter implements NativeConverter<Direction, EnumFacing> { @Override public Direction toNova(@Nullable EnumFacing facing) { if (null == facing) return Direction.UNKNOWN; else switch (facing) { case DOWN: return Direction.DOWN; case UP: return Direction.UP; case NORTH: return Direction.NORTH; case SOUTH: return Direction.SOUTH; case WEST: return Direction.WEST; case EAST: return Direction.EAST; default: return Direction.UNKNOWN; } }  static DirectionConverter instance(); @Override Class<Direction> getNovaSide(); @Override Class<EnumFacing> getNativeSide(); @Override Direction toNova(@Nullable EnumFacing facing); @Override @Nullable EnumFacing toNative(Direction direction); }
DirectionConverter implements NativeConverter<Direction, EnumFacing> { @Override public Direction toNova(@Nullable EnumFacing facing) { if (null == facing) return Direction.UNKNOWN; else switch (facing) { case DOWN: return Direction.DOWN; case UP: return Direction.UP; case NORTH: return Direction.NORTH; case SOUTH: return Direction.SOUTH; case WEST: return Direction.WEST; case EAST: return Direction.EAST; default: return Direction.UNKNOWN; } }  static DirectionConverter instance(); @Override Class<Direction> getNovaSide(); @Override Class<EnumFacing> getNativeSide(); @Override Direction toNova(@Nullable EnumFacing facing); @Override @Nullable EnumFacing toNative(Direction direction);  }