Sonar Fixes, Formatting
[aaf/authz.git] / cadi / aaf / src / main / java / org / onap / aaf / cadi / aaf / client / Examples.java
index 921b509..6520294 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -85,12 +85,12 @@ public class Examples {
         } else {
             className = nameOrContentType;
         }
-        
+
         // No Void.class in aaf.v2_0 package causing errors when trying to use a newVoidv2_0
         // method similar to others in this class. This makes it work, but is it right?
         if ("Void".equals(className))
             return "";
-                
+
         if ("1.1".equals(version)) {
             version = "v1_0";
         } else if (version!=null) {
@@ -98,7 +98,7 @@ public class Examples {
         } else {
             version = "v2_0";
         }
-        
+
         Class<?> cls=null;
         int minorIdx = version.indexOf('_');
         if(minorIdx<0) {
@@ -115,29 +115,29 @@ public class Examples {
                 }
             }
         }
-        
+
         if(cls==null) {
             throw new APIException("ERROR: " + "aaf."+vprefix+"X not found.");
         }
-        
+
         Method meth;
         try {
             meth = Examples.class.getDeclaredMethod("new"+cls.getSimpleName()+vprefix+minor,boolean.class);
         } catch (Exception e) {
             throw new APIException("ERROR: " + cls.getName() + " does not have an Example in Code.  Request from AAF Developers");
         }
-        
+
         RosettaDF<C> df = env.newDataFactory(cls);
         df.option(Data.PRETTY);
-        
+
         Object data = meth.invoke(null,optional);
-        
+
         @SuppressWarnings("unchecked")
         String rv = df.newData().load((C)data).out(type).asString();
 //        Object obj = df.newData().in(type).load(rv).asObject();
         return rv;
     }
-    
+
     /*
      *  Set Base Class Request (easier than coding over and over)
      */
@@ -147,9 +147,9 @@ public class Examples {
         gc.add(GregorianCalendar.MONTH, 6);
         req.setEnd(Chrono.timeStamp(gc));
 //        req.setForce("false");
-        
+
     }
-    
+
     @SuppressWarnings("unused")
     private static Request newRequestv2_0(boolean optional) {
         Request r = new Request();
@@ -168,7 +168,7 @@ public class Examples {
         if (optional)setOptional(rpr);
         return rpr;
     }
-    
+
     @SuppressWarnings("unused")
     private static Roles newRolesv2_0(boolean optional) {
         Role r;
@@ -206,8 +206,8 @@ public class Examples {
 
         return rs;
     }
-    
-    
+
+
     @SuppressWarnings("unused")
     private static PermRequest newPermRequestv2_0(boolean optional) {
         PermRequest pr = new PermRequest();
@@ -216,12 +216,12 @@ public class Examples {
         pr.setAction("myAction");
         if (optional) {
             pr.setDescription("Short and meaningful verbiage about the Permission");
-            
+
             setOptional(pr);
         }
         return pr;
     }
-    
+
     @SuppressWarnings("unused")
     private static Perm newPermv2_0(boolean optional) {
         Perm pr = new Perm();
@@ -246,7 +246,7 @@ public class Examples {
         pr.setAction("myAction");
         return pr;
     }
-    
+
     @SuppressWarnings("unused")
     private static Perms newPermsv2_0(boolean optional) {
         Perms perms = new Perms();
@@ -268,9 +268,9 @@ public class Examples {
         p.getRoles().add("org.osaaf.myns.myRole2");
 
         return perms;
-        
+
     }
-    
+
     @SuppressWarnings("unused")
     private static UserRoleRequest newUserRoleRequestv2_0(boolean optional) {
         UserRoleRequest urr = new UserRoleRequest();
@@ -279,7 +279,7 @@ public class Examples {
         if (optional) setOptional(urr);
         return urr;
     }
-    
+
     @SuppressWarnings("unused")
     private static NsRequest newNsRequestv2_0(boolean optional) {
         NsRequest nr = new NsRequest();
@@ -287,7 +287,7 @@ public class Examples {
         nr.getResponsible().add("ab1234@people.osaaf.org");
         nr.getResponsible().add("cd5678@people.osaaf.org");
         nr.getAdmin().add("zy9876@people.osaaf.org");
-        nr.getAdmin().add("xw5432@people.osaaf.org");        
+        nr.getAdmin().add("xw5432@people.osaaf.org");
         if (optional) {
             nr.setDescription("This is my Namespace to set up");
             nr.setType("APP");
@@ -295,12 +295,12 @@ public class Examples {
         }
         return nr;
     }
-    
-    
+
+
     @SuppressWarnings("unused")
     private static Nss newNssv2_0(boolean optional) {
         Ns ns;
-        
+
         Nss nss = new Nss();
         nss.getNs().add(ns = new Nss.Ns());
         ns.setName("org.osaaf.myns");
@@ -309,14 +309,14 @@ public class Examples {
         ns.getAdmin().add("zy9876@people.osaaf.org");
         ns.getAdmin().add("xw5432@people.osaaf.org");
         ns.setDescription("This is my Namespace to set up");
-        
+
         nss.getNs().add(ns = new Nss.Ns());
         ns.setName("org.osaaf.myOtherNs");
         ns.getResponsible().add("ab1234@people.osaaf.org");
         ns.getResponsible().add("cd5678@people.osaaf.org");
         ns.getAdmin().add("zy9876@people.osaaf.org");
-        ns.getAdmin().add("xw5432@people.osaaf.org");        
-            
+        ns.getAdmin().add("xw5432@people.osaaf.org");
+
         return nss;
     }
     @SuppressWarnings("unused")
@@ -343,23 +343,23 @@ public class Examples {
 
         return cr;
     }
-    
+
     @SuppressWarnings("unused")
     private static Users newUsersv2_0(boolean optional) {
         User user;
-    
+
         Users users = new Users();
     user = new Users.User();
         users.getUser().add(user);
-        user.setId("ab1234@people.osaaf.org");    
+        user.setId("ab1234@people.osaaf.org");
         GregorianCalendar gc = new GregorianCalendar();
         user.setExpires(Chrono.timeStamp(gc));
 
     user = new Users.User();
         users.getUser().add(user);
-        user.setId("zy9876@people.osaaf.org");    
-        user.setExpires(Chrono.timeStamp(gc));    
-            
+        user.setId("zy9876@people.osaaf.org");
+        user.setExpires(Chrono.timeStamp(gc));
+
         return users;
     }
 
@@ -400,7 +400,7 @@ public class Examples {
         ur.setRole("com.test.myapp.myRole");
         ur.setExpires(Chrono.timeStamp());
         urs.getUserRole().add(ur);
-        
+
         ur = new UserRole();
         ur.setUser("yx4321");
         ur.setRole("com.test.yourapp.yourRole");
@@ -453,7 +453,7 @@ public class Examples {
         return a;
     }
 
-    
+
 
     @SuppressWarnings("unused")
     private static aaf.v2_0.Error newErrorv2_0(boolean optional) {