applyMask

public static Collection<M> applyMask<M extends Message>(FieldMask mask, Collection<M> messages)

Applies the given FieldMask to given collection of Messages. Does not change the Collection itself.

If the FieldMask instance contains invalid field declarations, they are ignored and do not affect the execution result.

Return

messages with the FieldMask applied

Parameters

mask

FieldMask to apply to each item of the input Collection.

messages

Messages to filter.


public static M applyMask<M extends Message>(FieldMask mask, M message)

Applies the FieldMask to the given Message if the mask parameter is valid.

If the FieldMask instance contains invalid field declarations, they are ignored and do not affect the execution result.

Return

the message of the same type as the given one with only selected fields if the mask is valid, original message otherwise.

Parameters

mask

the FieldMask to apply.

message

the Message to apply given mask to.