@Generated(value="proto")
public final class DiscardUnknownFieldsParser
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T extends Message> |
wrap(Parser<T> parser)
|
public static final <T extends Message> Parser<T> wrap(Parser<T> parser)
Parser into a new Parser that discards unknown fields during
parsing.
Usage example:
private final static Parser<Foo> FOO_PARSER = DiscardUnknownFieldsParser.wrap(Foo.parser());
Foo parseFooDiscardUnknown(ByteBuffer input) throws IOException {
return FOO_PARSER.parseFrom(input);
}
Like all other implementations of Parser, this parser is stateless and thread-safe.
parser - The delegated parser that parses messages.Parser that will discard unknown fields during parsing.Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.