Эх сурвалжийг харах

use lombok for constructors and getter/setter methods

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 6 жил өмнө
parent
commit
d29e120f31

+ 7 - 20
src/main/java/com/owncloud/android/ui/dialog/parcel/MenuItemParcelable.java

@@ -4,11 +4,14 @@ import android.os.Parcel;
 import android.os.Parcelable;
 import android.os.Parcelable;
 import android.view.MenuItem;
 import android.view.MenuItem;
 
 
-public class MenuItemParcelable implements Parcelable {
-    int mMenuItemId;
-    String mMenuText;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
 
 
-    public MenuItemParcelable() {}
+@NoArgsConstructor
+public class MenuItemParcelable implements Parcelable {
+    @Getter @Setter int mMenuItemId;
+    @Getter @Setter String mMenuText;
 
 
     public MenuItemParcelable(MenuItem menuItem) {
     public MenuItemParcelable(MenuItem menuItem) {
         mMenuItemId = menuItem.getItemId();
         mMenuItemId = menuItem.getItemId();
@@ -19,22 +22,6 @@ public class MenuItemParcelable implements Parcelable {
         mMenuItemId = read.readInt();
         mMenuItemId = read.readInt();
     }
     }
 
 
-    public void setMenuItemId(int id) {
-        mMenuItemId = id;
-    }
-
-    public int getMenuItemId() {
-        return mMenuItemId;
-    }
-
-    public String getMenuText() {
-        return mMenuText;
-    }
-
-    public void setMenuText(String mMenuText) {
-        this.mMenuText = mMenuText;
-    }
-
     public static final Parcelable.Creator<MenuItemParcelable> CREATOR =
     public static final Parcelable.Creator<MenuItemParcelable> CREATOR =
             new Parcelable.Creator<MenuItemParcelable>() {
             new Parcelable.Creator<MenuItemParcelable>() {
 
 

+ 4 - 4
src/main/java/com/owncloud/android/ui/dialog/parcel/SyncedFolderParcelable.java

@@ -1,4 +1,4 @@
-/**
+/*
  * Nextcloud Android client application
  * Nextcloud Android client application
  *
  *
  * @author Andy Scherzinger
  * @author Andy Scherzinger
@@ -27,9 +27,12 @@ import com.owncloud.android.datamodel.MediaFolderType;
 import com.owncloud.android.datamodel.SyncedFolderDisplayItem;
 import com.owncloud.android.datamodel.SyncedFolderDisplayItem;
 import com.owncloud.android.files.services.FileUploader;
 import com.owncloud.android.files.services.FileUploader;
 
 
+import lombok.NoArgsConstructor;
+
 /**
 /**
  * Parcelable for {@link SyncedFolderDisplayItem} objects to transport them from/to dialog fragments.
  * Parcelable for {@link SyncedFolderDisplayItem} objects to transport them from/to dialog fragments.
  */
  */
+@NoArgsConstructor
 public class SyncedFolderParcelable implements Parcelable {
 public class SyncedFolderParcelable implements Parcelable {
     private String mFolderName;
     private String mFolderName;
     private String mLocalPath;
     private String mLocalPath;
@@ -44,9 +47,6 @@ public class SyncedFolderParcelable implements Parcelable {
     private String mAccount;
     private String mAccount;
     private int mSection;
     private int mSection;
 
 
-    public SyncedFolderParcelable() {
-    }
-
     public SyncedFolderParcelable(SyncedFolderDisplayItem syncedFolderDisplayItem, int section) {
     public SyncedFolderParcelable(SyncedFolderDisplayItem syncedFolderDisplayItem, int section) {
         mId = syncedFolderDisplayItem.getId();
         mId = syncedFolderDisplayItem.getId();
         mFolderName = syncedFolderDisplayItem.getFolderName();
         mFolderName = syncedFolderDisplayItem.getFolderName();

+ 6 - 8
src/main/java/com/owncloud/android/ui/events/SyncEventFinished.java

@@ -1,4 +1,4 @@
-/**
+/*
  * Nextcloud Android client application
  * Nextcloud Android client application
  *
  *
  * @author Mario Danic
  * @author Mario Danic
@@ -23,17 +23,15 @@ import android.content.Intent;
 
 
 import org.parceler.Parcel;
 import org.parceler.Parcel;
 
 
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+
 @Parcel
 @Parcel
+@NoArgsConstructor
+@AllArgsConstructor
 public class SyncEventFinished {
 public class SyncEventFinished {
     public Intent intent;
     public Intent intent;
 
 
-    public SyncEventFinished(Intent intent) {
-        this.intent = intent;
-    }
-
-    public SyncEventFinished() {
-    }
-
     public Intent getIntent() {
     public Intent getIntent() {
         return intent;
         return intent;
     }
     }

+ 5 - 9
src/main/java/com/owncloud/android/utils/svg/SvgDecoder.java

@@ -21,22 +21,18 @@ import com.caverock.androidsvg.SVGParseException;
 import java.io.IOException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStream;
 
 
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+
 /**
 /**
  * Decodes an SVG internal representation from an {@link InputStream}.
  * Decodes an SVG internal representation from an {@link InputStream}.
  */
  */
+@NoArgsConstructor
+@AllArgsConstructor
 public class SvgDecoder implements ResourceDecoder<InputStream, SVG> {
 public class SvgDecoder implements ResourceDecoder<InputStream, SVG> {
     private int height = -1;
     private int height = -1;
     private int width = -1;
     private int width = -1;
 
 
-    public SvgDecoder(){
-
-    }
-
-    public SvgDecoder(int height, int width) {
-        this.height = height;
-        this.width = width;
-    }
-
     public Resource<SVG> decode(InputStream source, int w, int h) throws IOException {
     public Resource<SVG> decode(InputStream source, int w, int h) throws IOException {
         try {
         try {
             SVG svg = SVG.getFromInputStream(source);
             SVG svg = SVG.getFromInputStream(source);