Bläddra i källkod

codacy: Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 4 år sedan
förälder
incheckning
d62c2b3f9f

+ 24 - 25
src/main/java/com/owncloud/android/datamodel/Template.java

@@ -27,9 +27,17 @@ import java.util.Locale;
 /**
  * Template for creating a file from it via RichDocuments app
  */
-
 @Parcel
 public class Template {
+    public int id;
+    public String name;
+    public String thumbnailLink;
+    public Type type;
+    public String extension;
+
+    public Template() {
+    }
+
     public Template(int id, String name, String thumbnailLink, Type type, String extension) {
         this.id = id;
         this.name = name;
@@ -38,7 +46,21 @@ public class Template {
         this.extension = extension;
     }
 
-    public Template() {
+    public enum Type {
+        DOCUMENT, SPREADSHEET, PRESENTATION, UNKNOWN
+    }
+
+    public static Type parse(String type) {
+        switch (type.toLowerCase(Locale.US)) {
+            case "document":
+                return Type.DOCUMENT;
+            case "spreadsheet":
+                return Type.SPREADSHEET;
+            case "presentation":
+                return Type.PRESENTATION;
+            default:
+                return Type.UNKNOWN;
+        }
     }
 
     public int getId() {
@@ -80,27 +102,4 @@ public class Template {
     public void setExtension(String extension) {
         this.extension = extension;
     }
-
-    public enum Type {
-        DOCUMENT, SPREADSHEET, PRESENTATION, UNKNOWN
-    }
-
-    public static Type parse(String type) {
-        switch (type.toLowerCase(Locale.US)) {
-            case "document":
-                return Type.DOCUMENT;
-            case "spreadsheet":
-                return Type.SPREADSHEET;
-            case "presentation":
-                return Type.PRESENTATION;
-            default:
-                return Type.UNKNOWN;
-        }
-    }
-
-    public int id;
-    public String name;
-    public String thumbnailLink;
-    public Type type;
-    public String extension;
 }

+ 5 - 5
src/main/java/com/owncloud/android/datastorage/StoragePoint.java

@@ -25,6 +25,11 @@ package com.owncloud.android.datastorage;
  * @author Bartosz Przybylski
  */
 public class StoragePoint implements Comparable<StoragePoint> {
+    private String description;
+    private String path;
+    private StorageType storageType;
+    private PrivacyType privacyType;
+    
     public StoragePoint(String description, String path, StorageType storageType, PrivacyType privacyType) {
         this.description = description;
         this.path = path;
@@ -75,11 +80,6 @@ public class StoragePoint implements Comparable<StoragePoint> {
         PRIVATE, PUBLIC
     }
 
-    private String description;
-    private String path;
-    private StorageType storageType;
-    private PrivacyType privacyType;
-
     @Override
     public int compareTo(StoragePoint another) {
         return path.compareTo(another.getPath());