mirror of
https://github.com/lightbend/config.git
synced 2025-03-18 21:30:30 +08:00
Add since 1.3.0 tags to the new ConfigMemorySize methods
This commit is contained in:
parent
97718593c6
commit
51f05d9927
@ -593,6 +593,8 @@ public interface Config extends ConfigMergeable {
|
||||
* href="https://github.com/typesafehub/config/blob/master/HOCON.md">the
|
||||
* spec</a>.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*
|
||||
* @param path
|
||||
* path expression
|
||||
* @return the value at the requested path, in bytes
|
||||
@ -706,6 +708,15 @@ public interface Config extends ConfigMergeable {
|
||||
|
||||
List<Long> getBytesList(String path);
|
||||
|
||||
/**
|
||||
* Gets a list, converting each value in the list to a memory size, using the
|
||||
* same rules as {@link #getMemorySize(String)}.
|
||||
*
|
||||
* @since 1.3.0
|
||||
* @param path
|
||||
* a path expression
|
||||
* @return list of memory sizes
|
||||
*/
|
||||
List<ConfigMemorySize> getMemorySizeList(String path);
|
||||
|
||||
/**
|
||||
|
@ -7,6 +7,8 @@ package com.typesafe.config;
|
||||
* An immutable class representing an amount of memory. Use
|
||||
* static factory methods such as {@link
|
||||
* ConfigMemorySize#ofBytes(long)} to create instances.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
public final class ConfigMemorySize {
|
||||
private final long bytes;
|
||||
@ -20,6 +22,7 @@ public final class ConfigMemorySize {
|
||||
/**
|
||||
* Constructs a ConfigMemorySize representing the given
|
||||
* number of bytes.
|
||||
* @since 1.3.0
|
||||
*/
|
||||
public static ConfigMemorySize ofBytes(long bytes) {
|
||||
return new ConfigMemorySize(bytes);
|
||||
@ -27,6 +30,7 @@ public final class ConfigMemorySize {
|
||||
|
||||
/**
|
||||
* Gets the size in bytes.
|
||||
* @since 1.3.0
|
||||
*/
|
||||
public long toBytes() {
|
||||
return bytes;
|
||||
|
Loading…
Reference in New Issue
Block a user