com.hazelcast.nio.serialization

## Enum SerializableByConvention.Reason

- java.lang.Object
- - java.lang.Enum<SerializableByConvention.Reason>
  - - com.hazelcast.nio.serialization.SerializableByConvention.Reason

- All Implemented Interfaces:
    Serializable, Comparable<SerializableByConvention.Reason>
  Enclosing class:
    SerializableByConvention

      public static enum SerializableByConvention.Reason
      extends Enum<SerializableByConvention.Reason>

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `INHERITANCE` Class is `Serializable` due to inheritance or other coding conventions and cannot or is not desirable to have it converted to `IdentifiedDataSerializable`.
    `PUBLIC_API` Class definition is part of public API so cannot be migrated to `IdentifiedDataSerializable` in minor or patch releases.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SerializableByConvention.Reason` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static SerializableByConvention.Reason[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### PUBLIC_API

          public static final SerializableByConvention.Reason PUBLIC_API

      Class definition is part of public API so cannot be migrated to `IdentifiedDataSerializable` in minor or patch releases.

    - #### INHERITANCE

          public static final SerializableByConvention.Reason INHERITANCE

      Class is `Serializable` due to inheritance or other coding conventions and cannot or is not desirable to have it converted to `IdentifiedDataSerializable`. Examples:
      - inheritance from a `Serializable` class external to Hazelcast e.g. `CacheEntryEvent` is serializable however its implementation in `CacheEntryEventImpl` is never used in serialized form, so there is no interest in converting this class to `IdentifiedDataSerializable`
      - a `Comparator` which should by convention also implement `Serializable`.
      Classes whose superclasses are `Serializable` without a default constructor or with private final fields, such as `Throwable` or `EventObject`, cannot be converted to `IdentifiedDataSerializable`, so these are not annotated with `SerializableByConvention`. Instead these classes are white-listed in `com.hazelcast.internal.serialization.impl.DataSerializableConventionsTest#SERIALIZABLE_WHITE_LIST` and are excluded from conventions testing.

  - ### Method Detail

    - #### values

          public static SerializableByConvention.Reason[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (SerializableByConvention.Reason c : SerializableByConvention.Reason.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static SerializableByConvention.Reason valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

Copyright © 2020. All rights reserved.