public static Property getChildAddress ( final ModelNode address ) { if ( address . getType ( ) != ModelType . LIST ) { throw new IllegalArgumentException ( "The address type must be a list." ) ; } final List < Property > addressParts = address . asPropertyList ( ) ; if ( addressParts . isEmpty ( ) ) { throw new IllegalArgumentException ( "The address is empty." ) ; } return addressParts . get ( addressParts . size ( ) - 1 ) ; }
Finds the last entry of the address list and returns it as a property .