0
한 protobuff 객체를 복사 I했습니다 예를 들어 두 개의 protobuff 객체의 소스 및 대상자바는 다른 protobuff 객체
message Source{
optional string firstName = 1;
optional string lastName = 2;
}
message Target {
optional string firstName = 1;
optional string lastName = 2;
}
타겟팅하는 소스에서 필드를 복사 할
, 내가
if(source.hasFirstName()) target.setFirstName(source.getFirstName());
if(source.hasLastName()) target.setLastName(source.getLastName());
이 솔루션
위의 코드는 길게 보입니다. 이것을 처리하기 위해 Java 8에서 사용할 수있는 간단한 솔루션이 있습니까?