2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.ws.sifts;
23 import jalview.bin.ApplicationSingletonProvider;
24 import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
26 import java.util.Objects;
28 public class SiftsSettings implements ApplicationSingletonI
32 * public only for testng
36 public static SiftsSettings getInstance()
38 return (SiftsSettings) ApplicationSingletonProvider
39 .getInstance(SiftsSettings.class);
42 private SiftsSettings()
44 // singleton; use getInstance()
47 private boolean mapWithSifts = false;
49 private String siftDownloadDirectory;
51 private int cacheThresholdInDays;
53 private int failSafePIDThreshold;
55 public static boolean isMapWithSifts()
57 return getInstance().mapWithSifts;
60 public static void setMapWithSifts(boolean mapWithSifts)
62 getInstance().mapWithSifts = mapWithSifts;
65 public static String getSiftDownloadDirectory()
67 return getInstance().siftDownloadDirectory;
70 public static void setSiftDownloadDirectory(String siftDownloadDirectory)
72 getInstance().siftDownloadDirectory = siftDownloadDirectory;
75 public static int getCacheThresholdInDays()
77 return getInstance().cacheThresholdInDays;
80 public static void setCacheThresholdInDays(String cacheThresholdInDays)
82 Objects.requireNonNull(cacheThresholdInDays);
83 getInstance().cacheThresholdInDays = Integer
84 .valueOf(cacheThresholdInDays);
87 public static int getFailSafePIDThreshold()
89 return getInstance().failSafePIDThreshold;
92 public static void setFailSafePIDThreshold(String failSafePIDThreshold)
94 Objects.requireNonNull(failSafePIDThreshold);
95 getInstance().failSafePIDThreshold = Integer
96 .valueOf(failSafePIDThreshold);