public class BencodedMap extends AbstractBencodedValue
| Constructor and Description |
|---|
BencodedMap()
Creates a new empty bencoded map.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,IBencodedValue> |
asMap() |
Optional<IBencodedValue> |
get(String name)
Gets the value from the map if available.
|
void |
put(String name,
IBencodedValue value)
Associates the given bencoded value with the given key.
|
Optional<IBencodedValue> |
remove(String name)
Removes a value from the map.
|
String |
serialize() |
asBigInteger, asList, asLong, asStringpublic void put(String name, IBencodedValue value)
name - The key to assign the value to.value - The value to assign.public Optional<IBencodedValue> get(String name)
name - The key to fetch the value for.public Optional<IBencodedValue> remove(String name)
name - The key to remove the value from.public Map<String,IBencodedValue> asMap()
asMap in interface IBencodedValueasMap in class AbstractBencodedValuepublic String serialize()
Copyright © 2016. All rights reserved.