com.hazelcast.config

## Class MaxSizeConfig

- java.lang.Object
- - com.hazelcast.config.MaxSizeConfig

- All Implemented Interfaces:
    DataSerializable, Serializable
  Direct Known Subclasses:
    MaxSizeConfigReadOnly

      public class MaxSizeConfig
      extends Object
      implements DataSerializable, Serializable

  Configuration for map's capacity. You can set a limit for number of entries or total memory cost of entries.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `MaxSizeConfig.MaxSizePolicy` Maximum Size Policy

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_MAX_SIZE` Default maximum size of map.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MaxSizeConfig()`
    `MaxSizeConfig(int size, MaxSizeConfig.MaxSizePolicy maxSizePolicy)`
    `MaxSizeConfig(MaxSizeConfig config)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `MaxSizeConfigReadOnly` | `getAsReadOnly()` Deprecated. this method will be removed in 4.0; it is meant for internal usage only
    `MaxSizeConfig.MaxSizePolicy` | `getMaxSizePolicy()` Returns the maximum size policy of the map.
    `int` | `getSize()` Returns the size of the map.
    `int` | `hashCode()`
    `void` | `readData(ObjectDataInput in)` Reads fields from the input stream
    `MaxSizeConfig` | `setMaxSizePolicy(MaxSizeConfig.MaxSizePolicy maxSizePolicy)` Ses the maximum size policy of the map.
    `MaxSizeConfig` | `setSize(int size)` Sets the maximum size of the map.
    `String` | `toString()`
    `void` | `writeData(ObjectDataOutput out)` Writes object fields to output stream

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_MAX_SIZE

          public static final int DEFAULT_MAX_SIZE

      Default maximum size of map.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MaxSizeConfig

          public MaxSizeConfig()

    - #### MaxSizeConfig

          public MaxSizeConfig(int size,
                               MaxSizeConfig.MaxSizePolicy maxSizePolicy)

    - #### MaxSizeConfig

          public MaxSizeConfig(MaxSizeConfig config)

  - ### Method Detail

    - #### getAsReadOnly

          public MaxSizeConfigReadOnly getAsReadOnly()

      Deprecated. this method will be removed in 4.0; it is meant for internal usage only
      Gets immutable version of this configuration.
      Returns:
        immutable version of this configuration

    - #### getSize

          public int getSize()

      Returns the size of the map.
      Returns:
        the size of the map

    - #### setSize

          public MaxSizeConfig setSize(int size)

      Sets the maximum size of the map.
      Parameters:
        `size` - the maximum size of the map
      Returns:
        the map MaxSizeConfig

    - #### getMaxSizePolicy

          public MaxSizeConfig.MaxSizePolicy getMaxSizePolicy()

      Returns the maximum size policy of the map.
      Returns:
        the MaxSizePolicy of the map

    - #### setMaxSizePolicy

          public MaxSizeConfig setMaxSizePolicy(MaxSizeConfig.MaxSizePolicy maxSizePolicy)

      Ses the maximum size policy of the map.
      Parameters:
        `maxSizePolicy` - the maximum size policy to set for the map
      Returns:
        this MaxSizeConfig

    - #### writeData

          public void writeData(ObjectDataOutput out)
                         throws IOException

      Description copied from interface: `DataSerializable`
      Writes object fields to output stream
      Specified by:
        `writeData` in interface `DataSerializable`
      Parameters:
        `out` - output
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the output stream has been closed.

    - #### readData

          public void readData(ObjectDataInput in)
                        throws IOException

      Description copied from interface: `DataSerializable`
      Reads fields from the input stream
      Specified by:
        `readData` in interface `DataSerializable`
      Parameters:
        `in` - input
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the input stream has been closed.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public final boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public final int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2020. All rights reserved.