15 lines
553 B
Java
15 lines
553 B
Java
package info.FrostFS.sdk.tools;
|
|
|
|
import com.google.protobuf.Message;
|
|
import com.google.protobuf.MessageOrBuilder;
|
|
|
|
public class MessageHelper {
|
|
|
|
public static Message getField(MessageOrBuilder messageOrBuilder, String fieldName) {
|
|
return (Message) messageOrBuilder.getField(messageOrBuilder.getDescriptorForType().findFieldByName(fieldName));
|
|
}
|
|
|
|
public static void setField(Message.Builder builder, String fieldName, Object value) {
|
|
builder.setField(builder.getDescriptorForType().findFieldByName(fieldName), value);
|
|
}
|
|
}
|