public class MetadataAdapter extends Object implements CallHeaders
This allows us to present the headers (metadata) from gRPC without copying to/from our own object.
Constructor and Description |
---|
MetadataAdapter(io.grpc.Metadata metadata) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(String key)
Check whether the given metadata key is present.
|
String |
get(String key)
Get the value of a metadata key.
|
Iterable<String> |
getAll(String key)
Get all values present for the given metadata key.
|
Iterable<byte[]> |
getAllByte(String key)
Get all values present for the given metadata key.
|
byte[] |
getByte(String key)
Get the value of a metadata key.
|
void |
insert(String key,
byte[] value)
Insert a metadata pair with the given value.
|
void |
insert(String key,
String value)
Insert a metadata pair with the given value.
|
Set<String> |
keys()
Get a set of all the metadata keys.
|
String |
toString() |
public String get(String key)
CallHeaders
get
in interface CallHeaders
public byte[] getByte(String key)
CallHeaders
getByte
in interface CallHeaders
public Iterable<String> getAll(String key)
CallHeaders
getAll
in interface CallHeaders
public Iterable<byte[]> getAllByte(String key)
CallHeaders
getAllByte
in interface CallHeaders
public void insert(String key, String value)
CallHeaders
Duplicate metadata are permitted.
insert
in interface CallHeaders
public void insert(String key, byte[] value)
CallHeaders
Duplicate metadata are permitted.
insert
in interface CallHeaders
public Set<String> keys()
CallHeaders
keys
in interface CallHeaders
public boolean containsKey(String key)
CallHeaders
containsKey
in interface CallHeaders
Copyright © 2023 The Apache Software Foundation. All rights reserved.