From d62c2b3f9f90f1b817c09e9e9a2426d06bb9b5f1 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Thu, 22 Oct 2020 17:08:40 +0200 Subject: [PATCH] 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 --- .../owncloud/android/datamodel/Template.java | 49 +++++++++---------- .../android/datastorage/StoragePoint.java | 10 ++-- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/owncloud/android/datamodel/Template.java b/src/main/java/com/owncloud/android/datamodel/Template.java index e98fb30efb..e6a029148c 100644 --- a/src/main/java/com/owncloud/android/datamodel/Template.java +++ b/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; } diff --git a/src/main/java/com/owncloud/android/datastorage/StoragePoint.java b/src/main/java/com/owncloud/android/datastorage/StoragePoint.java index 2beda44341..02865c59f4 100644 --- a/src/main/java/com/owncloud/android/datastorage/StoragePoint.java +++ b/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 { + 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 { 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());