@Test public void testUpdate() { Throttling throttling1 = new Throttling().setMaxRequests(50); ServiceMetadata metadata = ServiceMetadataBuilder.create() .throttling(throttling1) .build(); Assert.assertEquals(50, metadata.getThrottling().getMaxRequests()); Throttling throttling2 = new Throttling().setMaxRequests(150); ServiceMetadataBuilder.update(metadata).throttling(throttling2); Assert.assertEquals(150, metadata.getThrottling().getMaxRequests()); }
public static ServiceMetadataBuilder update(ServiceMetadata metadata) { if (!ServiceMetadataImpl.class.isInstance(metadata)) { throw APIMessages.MESSAGES.unableUpdateMetadataType(metadata.getClass().toString()); } return new ServiceMetadataBuilder((ServiceMetadataImpl)metadata); }
ServiceMetadataBuilder { public static ServiceMetadataBuilder update(ServiceMetadata metadata) { if (!ServiceMetadataImpl.class.isInstance(metadata)) { throw APIMessages.MESSAGES.unableUpdateMetadataType(metadata.getClass().toString()); } return new ServiceMetadataBuilder((ServiceMetadataImpl)metadata); } }
ServiceMetadataBuilder { public static ServiceMetadataBuilder update(ServiceMetadata metadata) { if (!ServiceMetadataImpl.class.isInstance(metadata)) { throw APIMessages.MESSAGES.unableUpdateMetadataType(metadata.getClass().toString()); } return new ServiceMetadataBuilder((ServiceMetadataImpl)metadata); } private  ServiceMetadataBuilder(); private  ServiceMetadataBuilder(ServiceMetadataImpl metadata); }
ServiceMetadataBuilder { public static ServiceMetadataBuilder update(ServiceMetadata metadata) { if (!ServiceMetadataImpl.class.isInstance(metadata)) { throw APIMessages.MESSAGES.unableUpdateMetadataType(metadata.getClass().toString()); } return new ServiceMetadataBuilder((ServiceMetadataImpl)metadata); } private  ServiceMetadataBuilder(); private  ServiceMetadataBuilder(ServiceMetadataImpl metadata); ServiceMetadataBuilder security(ServiceSecurity security); ServiceMetadataBuilder requiredPolicies(List<Policy> requiredPolicies); ServiceMetadataBuilder providedPolicies(List<Policy> providedPolicies); ServiceMetadataBuilder registrant(Registrant registrant); ServiceMetadataBuilder throttling(Throttling throttling); ServiceMetadata build(); static ServiceMetadataBuilder create(); static ServiceMetadataBuilder update(ServiceMetadata metadata); static ServiceMetadataBuilder createFrom(ServiceMetadata metadata); }
ServiceMetadataBuilder { public static ServiceMetadataBuilder update(ServiceMetadata metadata) { if (!ServiceMetadataImpl.class.isInstance(metadata)) { throw APIMessages.MESSAGES.unableUpdateMetadataType(metadata.getClass().toString()); } return new ServiceMetadataBuilder((ServiceMetadataImpl)metadata); } private  ServiceMetadataBuilder(); private  ServiceMetadataBuilder(ServiceMetadataImpl metadata); ServiceMetadataBuilder security(ServiceSecurity security); ServiceMetadataBuilder requiredPolicies(List<Policy> requiredPolicies); ServiceMetadataBuilder providedPolicies(List<Policy> providedPolicies); ServiceMetadataBuilder registrant(Registrant registrant); ServiceMetadataBuilder throttling(Throttling throttling); ServiceMetadata build(); static ServiceMetadataBuilder create(); static ServiceMetadataBuilder update(ServiceMetadata metadata); static ServiceMetadataBuilder createFrom(ServiceMetadata metadata);  }