From 092a05bda030c69e021a79426151be2f94c4b926 Mon Sep 17 00:00:00 2001
From: tpylak <tpylak>
Date: Thu, 22 Oct 2009 11:37:08 +0000
Subject: [PATCH] refactoring: GWT beans do not need any setters or getters

SVN: 13041
---
 .../DisplayedOrSelectedDatasetCriteria.java   | 29 -------------------
 .../DisplayedOrSelectedIdHolderCriteria.java  |  2 +-
 .../web/client/dto/TableModelReference.java   | 15 ----------
 .../dto/DatastoreServiceDescription.java      | 26 -----------------
 .../shared/basic/dto/DateTableCell.java       |  8 -----
 .../shared/basic/dto/ImageTableCell.java      | 21 --------------
 .../shared/basic/dto/NumberTableCell.java     |  9 ------
 .../shared/basic/dto/StringTableCell.java     |  9 ------
 .../generic/shared/basic/dto/TableModel.java  | 14 ---------
 .../shared/basic/dto/TableModelRow.java       |  8 -----
 10 files changed, 1 insertion(+), 140 deletions(-)

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedDatasetCriteria.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedDatasetCriteria.java
index e9fd8517c1d..14a318c1eaa 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedDatasetCriteria.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedDatasetCriteria.java
@@ -71,33 +71,4 @@ public final class DisplayedOrSelectedDatasetCriteria implements IsSerializable
     private DisplayedOrSelectedDatasetCriteria()
     {
     }
-
-    @SuppressWarnings("unused")
-    // GWT only
-    private TableExportCriteria<ExternalData> getDisplayedItemsOrNull()
-    {
-        return displayedItemsOrNull;
-    }
-
-    @SuppressWarnings("unused")
-    // GWT only
-    private void setDisplayedItemsOrNull(TableExportCriteria<ExternalData> displayedItemsOrNull)
-    {
-        this.displayedItemsOrNull = displayedItemsOrNull;
-    }
-
-    @SuppressWarnings("unused")
-    // GWT only
-    private List<String> getSelectedDatasetCodesOrNull()
-    {
-        return selectedDatasetCodesOrNull;
-    }
-
-    @SuppressWarnings("unused")
-    // GWT only
-    private void setSelectedDatasetCodesOrNull(List<String> selectedDatasetCodesOrNull)
-    {
-        this.selectedDatasetCodesOrNull = selectedDatasetCodesOrNull;
-    }
-
 }
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedIdHolderCriteria.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedIdHolderCriteria.java
index aa775de11f1..e79b5d120d3 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedIdHolderCriteria.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/DisplayedOrSelectedIdHolderCriteria.java
@@ -1 +1 @@
-/*
 * Copyright 2009 ETH Zuerich, CISD
 *
 * 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.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package ch.systemsx.cisd.openbis.generic.client.web.client.dto;

import java.util.List;

import com.google.gwt.user.client.rpc.IsSerializable;

import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder;
import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;

/**
 * Defines a set of {@link IIdHolder}s by either enumerating their ids or providing the grid
 * configuration for it (together with the cache identifier).
 * 
 * @author Izabela Adamczyk
 */
public final class DisplayedOrSelectedIdHolderCriteria<T extends IIdHolder> implements
        IsSerializable
{

    private TableExportCriteria<T> displayedItemsOrNull;

    private List<TechId> selectedItemsTechIdsOrNull;

    public static <T extends IIdHolder> DisplayedOrSelectedIdHolderCriteria<T> createSelectedItems(
            List<T> displayedItems)
    {
        return new DisplayedOrSelectedIdHolderCriteria<T>(null, TechId.createList(displayedItems));
    }

    public static <T extends IIdHolder> DisplayedOrSelectedIdHolderCriteria<T> createDisplayedItems(
            TableExportCriteria<T> tableExportCriteria)
    {
        return new DisplayedOrSelectedIdHolderCriteria<T>(tableExportCriteria, null);
    }

    private DisplayedOrSelectedIdHolderCriteria(TableExportCriteria<T> displayedItemsOrNull,
            List<TechId> selectedItemsTechIdOrNull)
    {
        this.displayedItemsOrNull = displayedItemsOrNull;
        selectedItemsTechIdsOrNull = selectedItemsTechIdOrNull;
    }

    public List<TechId> tryGetSelectedItems()
    {
        return selectedItemsTechIdsOrNull;
    }

    public TableExportCriteria<T> tryGetDisplayedItems()
    {
        return displayedItemsOrNull;
    }

    // GWT only
    @Deprecated
    private DisplayedOrSelectedIdHolderCriteria()
    {
    }

    // GWT only
    @SuppressWarnings("unused")
    @Deprecated
    private TableExportCriteria<T> getDisplayedItemsOrNull()
    {
        return displayedItemsOrNull;
    }

    // GWT only
    @SuppressWarnings("unused")
    @Deprecated
    private void setDisplayedItemsOrNull(TableExportCriteria<T> displayedItemsOrNull)
    {
        this.displayedItemsOrNull = displayedItemsOrNull;
    }

    // GWT only
    @SuppressWarnings("unused")
    @Deprecated
    private List<TechId> getSelectedItemsTechIdsOrNull()
    {
        return selectedItemsTechIdsOrNull;
    }

    // GWT only
    @SuppressWarnings("unused")
    @Deprecated
    private void setSelectedItemsTechIdsOrNull(List<TechId> selectedItemsTechIdsOrNull)
    {
        this.selectedItemsTechIdsOrNull = selectedItemsTechIdsOrNull;
    }

}
+/*
 * Copyright 2009 ETH Zuerich, CISD
 *
 * 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.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package ch.systemsx.cisd.openbis.generic.client.web.client.dto;

import java.util.List;

import com.google.gwt.user.client.rpc.IsSerializable;

import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder;
import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;

/**
 * Defines a set of {@link IIdHolder}s by either enumerating their ids or providing the grid
 * configuration for it (together with the cache identifier).
 * 
 * @author Izabela Adamczyk
 */
public final class DisplayedOrSelectedIdHolderCriteria<T extends IIdHolder> implements
        IsSerializable
{

    private TableExportCriteria<T> displayedItemsOrNull;

    private List<TechId> selectedItemsTechIdsOrNull;

    public static <T extends IIdHolder> DisplayedOrSelectedIdHolderCriteria<T> createSelectedItems(
            List<T> displayedItems)
    {
        return new DisplayedOrSelectedIdHolderCriteria<T>(null, TechId.createList(displayedItems));
    }

    public static <T extends IIdHolder> DisplayedOrSelectedIdHolderCriteria<T> createDisplayedItems(
            TableExportCriteria<T> tableExportCriteria)
    {
        return new DisplayedOrSelectedIdHolderCriteria<T>(tableExportCriteria, null);
    }

    private DisplayedOrSelectedIdHolderCriteria(TableExportCriteria<T> displayedItemsOrNull,
            List<TechId> selectedItemsTechIdOrNull)
    {
        this.displayedItemsOrNull = displayedItemsOrNull;
        selectedItemsTechIdsOrNull = selectedItemsTechIdOrNull;
    }

    public List<TechId> tryGetSelectedItems()
    {
        return selectedItemsTechIdsOrNull;
    }

    public TableExportCriteria<T> tryGetDisplayedItems()
    {
        return displayedItemsOrNull;
    }

    // GWT only
    @Deprecated
    private DisplayedOrSelectedIdHolderCriteria()
    {
    }
}
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/TableModelReference.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/TableModelReference.java
index aabba599c97..1cf3aa2e436 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/TableModelReference.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/TableModelReference.java
@@ -57,19 +57,4 @@ public class TableModelReference implements IsSerializable
     private TableModelReference()
     {
     }
-
-    // GWT only
-    @SuppressWarnings("unused")
-    private void setResultSetKey(String resultSetKey)
-    {
-        this.resultSetKey = resultSetKey;
-    }
-
-    // GWT only
-    @SuppressWarnings("unused")
-    private void setHeader(List<TableModelColumnHeader> header)
-    {
-        this.header = header;
-    }
-
 }
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DatastoreServiceDescription.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DatastoreServiceDescription.java
index 3bdb92fedb8..c3bf61d8a0f 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DatastoreServiceDescription.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DatastoreServiceDescription.java
@@ -87,32 +87,6 @@ public class DatastoreServiceDescription implements IsSerializable, Serializable
         this.downloadURL = downloadURL;
     }
     
-    // for GWT serialization
-
-    @SuppressWarnings("unused")
-    private void setKey(String key)
-    {
-        this.key = key;
-    }
-
-    @SuppressWarnings("unused")
-    private void setLabel(String label)
-    {
-        this.label = label;
-    }
-
-    @SuppressWarnings("unused")
-    private void setDatasetTypeCodes(String[] datasetTypeCodes)
-    {
-        this.datasetTypeCodes = datasetTypeCodes;
-    }
-
-    @SuppressWarnings("unused")
-    private void setDatastoreCode(String datastoreCode)
-    {
-        this.datastoreCode = datastoreCode;
-    }
-
     @Override
     public String toString()
     {
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DateTableCell.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DateTableCell.java
index b3bd7f1ec35..b3ce0526263 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DateTableCell.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/DateTableCell.java
@@ -79,12 +79,4 @@ public class DateTableCell implements ISerializableComparable
     private DateTableCell()
     {
     }
-    
-    // GWT only
-    @SuppressWarnings("unused")
-    private void setDateTime(long dateTime)
-    {
-        this.dateTime = dateTime;
-    }
-
 }
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ImageTableCell.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ImageTableCell.java
index 41778809306..1c8bc5ea0e7 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ImageTableCell.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/ImageTableCell.java
@@ -101,26 +101,5 @@ public class ImageTableCell implements ISerializableComparable
     private ImageTableCell()
     {
     }
-
-    // GWT only
-    @SuppressWarnings("unused")
-    private void setPath(String path)
-    {
-        this.path = path;
-    }
-    
-    // GWT only
-    @SuppressWarnings("unused")
-    private void setMaxThumbnailWidth(int maxThumbnailWidth)
-    {
-        this.maxThumbnailWidth = maxThumbnailWidth;
-    }
-    
-    // GWT only
-    @SuppressWarnings("unused")
-    private void setMaxThumbnailHeight(int maxThumbnailHeight)
-    {
-        this.maxThumbnailHeight = maxThumbnailHeight;
-    }
 }
 
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NumberTableCell.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NumberTableCell.java
index 358f66bf31a..9dd607b1509 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NumberTableCell.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/NumberTableCell.java
@@ -75,13 +75,4 @@ public class NumberTableCell implements ISerializableComparable
     private NumberTableCell()
     {
     }
-
-    // GWT only
-    @SuppressWarnings("unused")
-    private void setNumber(double number)
-    {
-        this.number = number;
-    }
-
-    
 }
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/StringTableCell.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/StringTableCell.java
index eef53885a0b..f1f55fe59e1 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/StringTableCell.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/StringTableCell.java
@@ -68,13 +68,4 @@ public class StringTableCell implements ISerializableComparable
     private StringTableCell()
     {
     }
-
-    // GWT only
-    @SuppressWarnings("unused")
-    private void setString(String string)
-    {
-        this.string = string;
-    }
-
-    
 }
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TableModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TableModel.java
index 0b653bf852d..951b0ffbe02 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TableModel.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TableModel.java
@@ -65,18 +65,4 @@ public class TableModel implements IsSerializable, Serializable
     private TableModel()
     {
     }
-
-    // GWT only
-    @SuppressWarnings("unused")
-    private void setRows(List<TableModelRow> rows)
-    {
-        this.rows = rows;
-    }
-
-    // GWT only
-    @SuppressWarnings("unused")
-    private void setHeader(List<TableModelColumnHeader> header)
-    {
-        this.header = header;
-    }
 }
diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TableModelRow.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TableModelRow.java
index 8c4e7d557d3..64e8155b766 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TableModelRow.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/TableModelRow.java
@@ -50,12 +50,4 @@ public class TableModelRow implements IsSerializable, Serializable
     private TableModelRow()
     {
     }
-
-    // GWT only
-    @SuppressWarnings("unused")
-    private void setValues(List<ISerializableComparable> values)
-    {
-        this.values = values;
-    }
-
 }
-- 
GitLab