public static ServiceInstance toServiceInstance ( ModelServiceInstance modelInstance ) { if ( modelInstance == null ) throw new NullPointerException ( ) ; Map < String , String > meta = new HashMap <> ( ) ; if ( modelInstance . getMetadata ( ) != null ) { for ( Entry < String , String > en : modelInstance . getMetadata ( ) . entrySet ( ) ) { meta . put ( en . getKey ( ) , en . getValue ( ) ) ; } } return new ServiceInstance ( modelInstance . getServiceName ( ) , modelInstance . getUri ( ) , modelInstance . isMonitorEnabled ( ) , modelInstance . getStatus ( ) , modelInstance . getAddress ( ) , meta , modelInstance . getPort ( ) , modelInstance . getTls_port ( ) , modelInstance . getProtocol ( ) ) ; }
Convert a ModelServiceInstance to a ServiceInstance object .