Package | Description |
---|---|
com.stevewedig.blog.symbol | |
com.stevewedig.blog.symbol.translate |
Modifier and Type | Method and Description |
---|---|
static <Value> Symbol<Value> |
SymbolLib.symbol(String name)
Create a symbol from a name and a Value parameter.
|
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableSet<Symbol<?>> |
SymbolSchema.optionalSymbols()
Just the optional symbols in the schema.
|
com.google.common.collect.ImmutableSet<Symbol<?>> |
SymbolSchema.requiredSymbols()
Just the required symbols in the schema.
|
static List<Symbol<?>> |
SymbolLib.sortSymbols(Iterable<Symbol<?>> symbols)
Sort symbols by name.
|
Map<Symbol<?>,Object> |
SymbolMap.stateCopy()
Get a Map copy of the state.
|
com.google.common.collect.ImmutableSet<Symbol<?>> |
SymbolSchema.symbols()
All of the symbols in the schema.
|
com.google.common.collect.ImmutableSet<Symbol<?>> |
SymbolMap.symbols()
The set of contained symbols.
|
Modifier and Type | Method and Description |
---|---|
boolean |
SymbolMap.contains(Symbol<?> symbol)
Is the symbol a key in the SymbolMap?
|
<Value> Value |
SymbolMap.get(Symbol<Value> symbol)
Get the value associated with a symbol.
|
<Value> Value |
SymbolMap.getDefault(Symbol<Value> symbol,
Value defaultValue)
Get the value associated with a symbol, or the defaultValue if it is missing, or the
defaultValue if the value is null.
|
<Value> Value |
SymbolMap.getDefault(Symbol<Value> symbol,
Value defaultValue,
boolean adaptNull)
Get the value associated with a symbol, or the defaultValue if it is missing, or the
defaultValue if its null and adaptNull = true.
|
<Value> Value |
SymbolMap.getNullable(Symbol<Value> symbol)
Get the value associated with a symbol, or null if it is missing.
|
<Value> com.google.common.base.Optional<Value> |
SymbolMap.getOptional(Symbol<Value> symbol)
Get the value associated with a symbol, or Optional.absent if it is missing, or Optional.absent
if the value is null.
|
<Value> com.google.common.base.Optional<Value> |
SymbolMap.getOptional(Symbol<Value> symbol,
boolean adaptNull)
Get the value associated with a symbol, or Optional.absent if it is missing, or Optional.absent
if the value is null and adaptTrue = true.
|
<Event> void |
SymbolBus.publish(Symbol<Event> symbol,
Event event)
Publish an event to a symbol of the corresponding type.
|
<Value> SymbolMap.Fluid |
SymbolMap.Fluid.put(Symbol<Value> symbol,
Value value)
Set the value associated with a symbol and return the map for use in map.put(k1, v1).put(k2,
v2)...
|
static SymbolSchema |
SymbolLib.schema(Symbol<?>... requiredSymbols)
Create a SymbolSchema from required symbols.
|
<Event> void |
SymbolBus.subscribe(Symbol<Event> symbol,
LambdaLib.Act1<Event> callback)
Subscribe to a symbol's events.
|
<Event> void |
SymbolBus.unsubscribe(Symbol<Event> symbol,
LambdaLib.Act1<Event> callback)
Stop subscribing to a symbol's events.
|
void |
SymbolSchema.validate(Symbol<?>... symbols)
Validate that required symbols are provided and that the provided symbols are all expected.
|
SymbolSchema |
SymbolSchema.withOptional(Symbol<?>... optionalSymbols)
Create a schema with the addition of the optionalSymbols, for use in creating schemas via
SymbolLib.schema(requiredSymbols...).withOptional(optionalSymbols...).
|
Modifier and Type | Method and Description |
---|---|
static SymbolMap.Fluid |
SymbolLib.map(Map<Symbol<?>,Object> state)
Create a SymbolMap.Fluid from its internal state, which is not statically checked.
|
static SymbolSchema |
SymbolLib.schema(Iterable<Symbol<?>> requiredSymbols)
Create a SymbolSchema from required symbols.
|
static SymbolSchema |
SymbolLib.schema(Iterable<Symbol<?>> requiredSymbols,
Iterable<Symbol<?>> optionalSymbols)
Create a SymbolSchema from required and optional symbols.
|
static SymbolSchema |
SymbolLib.schema(Iterable<Symbol<?>> requiredSymbols,
Iterable<Symbol<?>> optionalSymbols)
Create a SymbolSchema from required and optional symbols.
|
static SymbolMap.Solid |
SymbolLib.solidMap(Map<Symbol<?>,Object> state)
Create a SymbolMap.Solid from its internal state, which is not statically checked.
|
static List<Symbol<?>> |
SymbolLib.sortSymbols(Iterable<Symbol<?>> symbols)
Sort symbols by name.
|
void |
SymbolBus.subscribeAll(LambdaLib.Act2<Symbol<?>,Object> callback)
Subscribe to all events.
|
void |
SymbolBus.subscribeMisses(LambdaLib.Act2<Symbol<?>,Object> callback)
Subscribe to all events without subscribers.
|
void |
SymbolBus.unsubscribeAll(LambdaLib.Act2<Symbol<?>,Object> callback)
Stop subscribing to all events.
|
void |
SymbolBus.unsubscribeMisses(LambdaLib.Act2<Symbol<?>,Object> callback)
Stop subscribing to all events without subscribers.
|
void |
SymbolSchema.validate(Iterable<Symbol<?>> symbols)
Validate that required symbols are provided and that the provided symbols are all expected.
|
void |
SymbolSchema.validate(Set<Symbol<?>> symbols)
Validate that required symbols are provided and that the provided symbols are all expected.
|
Modifier and Type | Method and Description |
---|---|
SymbolWriter.Builder |
SymbolWriter.Builder.add(Symbol<String> symbol)
Add a String symbol and the default no-op writer.
|
SymbolTranslator.Builder |
SymbolTranslator.Builder.add(Symbol<String> symbol)
Add a String symbol and the default no-op format.
|
SymbolParser.Builder |
SymbolParser.Builder.add(Symbol<String> symbol)
Add a String symbol and the default no-op parser.
|
<Value> SymbolTranslator.Builder |
SymbolTranslator.Builder.add(Symbol<Value> symbol,
Format<Value> format)
Add a symbol and associated format.
|
<Value> SymbolParser.Builder |
SymbolParser.Builder.add(Symbol<Value> symbol,
FormatParser<Value> parser)
Add a symbol and associated parser.
|
<Value> SymbolWriter.Builder |
SymbolWriter.Builder.add(Symbol<Value> symbol,
FormatWriter<Value> Writer)
Add a symbol and associated writer.
|
<Value> Value |
SymbolParser.parse(Symbol<Value> symbol,
String valueStr)
Parse a string associated with a symbol.
|
<Value> String |
SymbolWriter.write(Symbol<Value> symbol,
Value value)
Writer a value associated with a symbol.
|
Copyright © 2014. All rights reserved.