com.esotericsoftware.kryo.util.Util.isClassAvailable()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(192)

本文整理了Java中com.esotericsoftware.kryo.util.Util.isClassAvailable()方法的一些代码示例,展示了Util.isClassAvailable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.isClassAvailable()方法的具体详情如下:
包路径:com.esotericsoftware.kryo.util.Util
类名称:Util
方法名:isClassAvailable

Util.isClassAvailable介绍

暂无

代码示例

代码示例来源:origin: com.esotericsoftware/kryo

  1. public static void addDefaultSerializers (Kryo kryo) {
  2. if (isClassAvailable("java.util.Optional")) kryo.addDefaultSerializer(Optional.class, new OptionalSerializer());
  3. if (isClassAvailable("java.util.OptionalInt")) kryo.addDefaultSerializer(OptionalInt.class, new OptionalIntSerializer());
  4. if (isClassAvailable("java.util.OptionalLong")) kryo.addDefaultSerializer(OptionalLong.class, new OptionalLongSerializer());
  5. if (isClassAvailable("java.util.OptionalDouble"))
  6. kryo.addDefaultSerializer(OptionalDouble.class, new OptionalDoubleSerializer());
  7. }

代码示例来源:origin: com.esotericsoftware/kryo-shaded

  1. public static void addDefaultSerializers (Kryo kryo) {
  2. if (isClassAvailable("java.util.Optional")) kryo.addDefaultSerializer(Optional.class, new OptionalSerializer());
  3. if (isClassAvailable("java.util.OptionalInt")) kryo.addDefaultSerializer(OptionalInt.class, new OptionalIntSerializer());
  4. if (isClassAvailable("java.util.OptionalLong")) kryo.addDefaultSerializer(OptionalLong.class, new OptionalLongSerializer());
  5. if (isClassAvailable("java.util.OptionalDouble"))
  6. kryo.addDefaultSerializer(OptionalDouble.class, new OptionalDoubleSerializer());
  7. }

代码示例来源:origin: com.esotericsoftware/kryo

  1. public static void addDefaultSerializers (Kryo kryo) {
  2. if (isClassAvailable("java.time.Duration")) kryo.addDefaultSerializer(Duration.class, new DurationSerializer());
  3. if (isClassAvailable("java.time.Instant")) kryo.addDefaultSerializer(Instant.class, new InstantSerializer());
  4. if (isClassAvailable("java.time.LocalDate")) kryo.addDefaultSerializer(LocalDate.class, new LocalDateSerializer());
  5. if (isClassAvailable("java.time.LocalTime")) kryo.addDefaultSerializer(LocalTime.class, new LocalTimeSerializer());
  6. if (isClassAvailable("java.time.LocalDateTime"))
  7. kryo.addDefaultSerializer(LocalDateTime.class, new LocalDateTimeSerializer());
  8. if (isClassAvailable("java.time.ZoneOffset")) kryo.addDefaultSerializer(ZoneOffset.class, new ZoneOffsetSerializer());
  9. if (isClassAvailable("java.time.ZoneId")) kryo.addDefaultSerializer(ZoneId.class, new ZoneIdSerializer());
  10. if (isClassAvailable("java.time.OffsetTime")) kryo.addDefaultSerializer(OffsetTime.class, new OffsetTimeSerializer());
  11. if (isClassAvailable("java.time.OffsetDateTime"))
  12. kryo.addDefaultSerializer(OffsetDateTime.class, new OffsetDateTimeSerializer());
  13. if (isClassAvailable("java.time.ZonedDateTime"))
  14. kryo.addDefaultSerializer(ZonedDateTime.class, new ZonedDateTimeSerializer());
  15. if (isClassAvailable("java.time.Year")) kryo.addDefaultSerializer(Year.class, new YearSerializer());
  16. if (isClassAvailable("java.time.YearMonth")) kryo.addDefaultSerializer(YearMonth.class, new YearMonthSerializer());
  17. if (isClassAvailable("java.time.MonthDay")) kryo.addDefaultSerializer(MonthDay.class, new MonthDaySerializer());
  18. if (isClassAvailable("java.time.Period")) kryo.addDefaultSerializer(Period.class, new PeriodSerializer());
  19. }

代码示例来源:origin: com.esotericsoftware/kryo-shaded

  1. public static void addDefaultSerializers (Kryo kryo) {
  2. if (isClassAvailable("java.time.Duration")) kryo.addDefaultSerializer(Duration.class, new DurationSerializer());
  3. if (isClassAvailable("java.time.Instant")) kryo.addDefaultSerializer(Instant.class, new InstantSerializer());
  4. if (isClassAvailable("java.time.LocalDate")) kryo.addDefaultSerializer(LocalDate.class, new LocalDateSerializer());
  5. if (isClassAvailable("java.time.LocalTime")) kryo.addDefaultSerializer(LocalTime.class, new LocalTimeSerializer());
  6. if (isClassAvailable("java.time.LocalDateTime"))
  7. kryo.addDefaultSerializer(LocalDateTime.class, new LocalDateTimeSerializer());
  8. if (isClassAvailable("java.time.ZoneOffset")) kryo.addDefaultSerializer(ZoneOffset.class, new ZoneOffsetSerializer());
  9. if (isClassAvailable("java.time.ZoneId")) kryo.addDefaultSerializer(ZoneId.class, new ZoneIdSerializer());
  10. if (isClassAvailable("java.time.OffsetTime")) kryo.addDefaultSerializer(OffsetTime.class, new OffsetTimeSerializer());
  11. if (isClassAvailable("java.time.OffsetDateTime"))
  12. kryo.addDefaultSerializer(OffsetDateTime.class, new OffsetDateTimeSerializer());
  13. if (isClassAvailable("java.time.ZonedDateTime"))
  14. kryo.addDefaultSerializer(ZonedDateTime.class, new ZonedDateTimeSerializer());
  15. if (isClassAvailable("java.time.Year")) kryo.addDefaultSerializer(Year.class, new YearSerializer());
  16. if (isClassAvailable("java.time.YearMonth")) kryo.addDefaultSerializer(YearMonth.class, new YearMonthSerializer());
  17. if (isClassAvailable("java.time.MonthDay")) kryo.addDefaultSerializer(MonthDay.class, new MonthDaySerializer());
  18. if (isClassAvailable("java.time.Period")) kryo.addDefaultSerializer(Period.class, new PeriodSerializer());
  19. }

相关文章