@Test public void testToNative() { assertThat(converter.toNative(Direction.DOWN)).isEqualTo(EnumFacing.DOWN); assertThat(converter.toNative(Direction.UP)).isEqualTo(EnumFacing.UP); assertThat(converter.toNative(Direction.NORTH)).isEqualTo(EnumFacing.NORTH); assertThat(converter.toNative(Direction.SOUTH)).isEqualTo(EnumFacing.SOUTH); assertThat(converter.toNative(Direction.WEST)).isEqualTo(EnumFacing.WEST); assertThat(converter.toNative(Direction.EAST)).isEqualTo(EnumFacing.EAST); assertThat(converter.toNative(Direction.UNKNOWN)).isNull(); }
@Override @Nullable public EnumFacing toNative(Direction direction) { switch (direction) { case DOWN: return EnumFacing.DOWN; case UP: return EnumFacing.UP; case NORTH: return EnumFacing.NORTH; case SOUTH: return EnumFacing.SOUTH; case WEST: return EnumFacing.WEST; case EAST: return EnumFacing.EAST; default: return null; } }
DirectionConverter implements NativeConverter<Direction, EnumFacing> { @Override @Nullable public EnumFacing toNative(Direction direction) { switch (direction) { case DOWN: return EnumFacing.DOWN; case UP: return EnumFacing.UP; case NORTH: return EnumFacing.NORTH; case SOUTH: return EnumFacing.SOUTH; case WEST: return EnumFacing.WEST; case EAST: return EnumFacing.EAST; default: return null; } } }
DirectionConverter implements NativeConverter<Direction, EnumFacing> { @Override @Nullable public EnumFacing toNative(Direction direction) { switch (direction) { case DOWN: return EnumFacing.DOWN; case UP: return EnumFacing.UP; case NORTH: return EnumFacing.NORTH; case SOUTH: return EnumFacing.SOUTH; case WEST: return EnumFacing.WEST; case EAST: return EnumFacing.EAST; default: return null; } }  }
DirectionConverter implements NativeConverter<Direction, EnumFacing> { @Override @Nullable public EnumFacing toNative(Direction direction) { switch (direction) { case DOWN: return EnumFacing.DOWN; case UP: return EnumFacing.UP; case NORTH: return EnumFacing.NORTH; case SOUTH: return EnumFacing.SOUTH; case WEST: return EnumFacing.WEST; case EAST: return EnumFacing.EAST; default: return null; } }  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 @Nullable public EnumFacing toNative(Direction direction) { switch (direction) { case DOWN: return EnumFacing.DOWN; case UP: return EnumFacing.UP; case NORTH: return EnumFacing.NORTH; case SOUTH: return EnumFacing.SOUTH; case WEST: return EnumFacing.WEST; case EAST: return EnumFacing.EAST; default: return null; } }  static DirectionConverter instance(); @Override Class<Direction> getNovaSide(); @Override Class<EnumFacing> getNativeSide(); @Override Direction toNova(@Nullable EnumFacing facing); @Override @Nullable EnumFacing toNative(Direction direction);  }