public Perspective addPerspective ( String name , String description ) { if ( StringUtils . isNullOrEmpty ( name ) ) { throw new IllegalArgumentException ( "A name must be specified." ) ; } if ( StringUtils . isNullOrEmpty ( description ) ) { throw new IllegalArgumentException ( "A description must be specified." ) ; } if ( perspectives . stream ( ) . filter ( p -> p . getName ( ) . equals ( name ) ) . count ( ) > 0 ) { throw new IllegalArgumentException ( "A perspective named \"" + name + "\" already exists." ) ; } Perspective perspective = new Perspective ( name , description ) ; perspectives . add ( perspective ) ; return perspective ; }
Adds a perspective to this model item .