mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-22 08:29:16 -04:00
Make persisted data final
This commit is contained in:
parent
6a25e1c56c
commit
485b33acf6
@ -30,7 +30,7 @@ import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class DisputeList<DisputeCase> extends ArrayList<DisputeCase> implements Persistable {
|
||||
public final class DisputeList<DisputeCase> extends ArrayList<DisputeCase> implements Persistable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -37,7 +37,7 @@ import java.io.ObjectInputStream;
|
||||
* That way we have a kind of separated trade wallet, isolated from other transactions and avoiding coin merge.
|
||||
* If we would not avoid coin merge the user would lose privacy between trades.
|
||||
*/
|
||||
public class AddressEntry implements Persistable {
|
||||
public final class AddressEntry implements Persistable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -31,7 +31,7 @@ import java.util.ArrayList;
|
||||
/**
|
||||
* The List supporting our persistence solution.
|
||||
*/
|
||||
public class AddressEntryList extends ArrayList<AddressEntry> implements Persistable {
|
||||
public final class AddressEntryList extends ArrayList<AddressEntry> implements Persistable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
private static final Logger log = LoggerFactory.getLogger(AddressEntryList.class);
|
||||
|
@ -23,7 +23,7 @@ import io.bitsquare.common.persistance.Persistable;
|
||||
import javax.annotation.concurrent.Immutable;
|
||||
|
||||
@Immutable
|
||||
public class Country implements Persistable {
|
||||
public final class Country implements Persistable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -18,9 +18,8 @@
|
||||
package io.bitsquare.locale;
|
||||
|
||||
import io.bitsquare.app.Version;
|
||||
import io.bitsquare.common.persistance.Persistable;
|
||||
|
||||
public class CryptoCurrency extends TradeCurrency implements Persistable {
|
||||
public final class CryptoCurrency extends TradeCurrency {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -18,12 +18,11 @@
|
||||
package io.bitsquare.locale;
|
||||
|
||||
import io.bitsquare.app.Version;
|
||||
import io.bitsquare.common.persistance.Persistable;
|
||||
import io.bitsquare.user.Preferences;
|
||||
|
||||
import java.util.Currency;
|
||||
|
||||
public class FiatCurrency extends TradeCurrency implements Persistable {
|
||||
public final class FiatCurrency extends TradeCurrency {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -23,7 +23,7 @@ import io.bitsquare.common.persistance.Persistable;
|
||||
import javax.annotation.concurrent.Immutable;
|
||||
|
||||
@Immutable
|
||||
public class Region implements Persistable {
|
||||
public final class Region implements Persistable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -20,7 +20,7 @@ package io.bitsquare.locale;
|
||||
import io.bitsquare.app.Version;
|
||||
import io.bitsquare.common.persistance.Persistable;
|
||||
|
||||
public class TradeCurrency implements Persistable {
|
||||
public abstract class TradeCurrency implements Persistable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -20,7 +20,7 @@ package io.bitsquare.payment;
|
||||
import io.bitsquare.app.Version;
|
||||
import io.bitsquare.locale.FiatCurrency;
|
||||
|
||||
public class AliPayAccount extends PaymentAccount {
|
||||
public final class AliPayAccount extends PaymentAccount {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -19,7 +19,7 @@ package io.bitsquare.payment;
|
||||
|
||||
import io.bitsquare.app.Version;
|
||||
|
||||
public class BlockChainAccount extends PaymentAccount {
|
||||
public final class BlockChainAccount extends PaymentAccount {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -22,7 +22,7 @@ import io.bitsquare.locale.CurrencyUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class OKPayAccount extends PaymentAccount {
|
||||
public final class OKPayAccount extends PaymentAccount {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public class PaymentAccount implements Persistable {
|
||||
public abstract class PaymentAccount implements Persistable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -28,7 +28,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
// Don't use Enum as it breaks serialisation when changing entries and we want to stay flexible here
|
||||
public class PaymentMethod implements Persistable, Comparable {
|
||||
public final class PaymentMethod implements Persistable, Comparable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -20,7 +20,7 @@ package io.bitsquare.payment;
|
||||
import io.bitsquare.app.Version;
|
||||
import io.bitsquare.locale.FiatCurrency;
|
||||
|
||||
public class PerfectMoneyAccount extends PaymentAccount {
|
||||
public final class PerfectMoneyAccount extends PaymentAccount {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -21,7 +21,7 @@ import io.bitsquare.app.Version;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SepaAccount extends PaymentAccount {
|
||||
public final class SepaAccount extends PaymentAccount {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -20,7 +20,7 @@ package io.bitsquare.payment;
|
||||
import io.bitsquare.app.Version;
|
||||
import io.bitsquare.locale.FiatCurrency;
|
||||
|
||||
public class SwishAccount extends PaymentAccount {
|
||||
public final class SwishAccount extends PaymentAccount {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -24,7 +24,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
// US only
|
||||
public class FedWireAccount extends PaymentAccount {
|
||||
public final class FedWireAccount extends PaymentAccount {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -23,7 +23,7 @@ import io.bitsquare.payment.PaymentMethod;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TransferWiseAccount extends PaymentAccount {
|
||||
public final class TransferWiseAccount extends PaymentAccount {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -22,7 +22,7 @@ import io.bitsquare.payment.PaymentAccount;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class USPostalMoneyOrderAccount extends PaymentAccount {
|
||||
public final class USPostalMoneyOrderAccount extends PaymentAccount {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
@ -32,7 +32,56 @@ public class USPostalMoneyOrderAccount extends PaymentAccount {
|
||||
private String iban;
|
||||
private String bic;
|
||||
|
||||
|
||||
/*
|
||||
- Message (interface):
|
||||
- GetDataRequest (Interface)
|
||||
- PreliminaryGetDataRequest (final class) impl. AnonymousMessage
|
||||
- GetUpdatedDataRequest (final class) impl. SendersNodeAddressMessage
|
||||
- SendersNodeAddressMessage (Interface)
|
||||
- PrefixedSealedAndSignedMessage (final class) impl. MailboxMessage
|
||||
- GetUpdatedDataRequest (final class) impl. GetDataRequest
|
||||
- GetPeersRequest (final class) extends PeerExchangeMessage
|
||||
- AnonymousMessage (Interface)
|
||||
- PreliminaryGetDataRequest (final class) impl. GetDataRequest
|
||||
- DirectMessage (Interface)
|
||||
- OfferMessage (abstract class)
|
||||
- OfferAvailabilityRequest (final class)
|
||||
- OfferAvailabilityResponse (final class)
|
||||
- TradeMessage (abstract class)
|
||||
- DepositTxPublishedMessage (final class) implements MailboxMessage
|
||||
- FiatTransferStartedMessage (final class) implements MailboxMessage
|
||||
- FinalizePayoutTxRequest (final class) implements MailboxMessage
|
||||
- PayDepositRequest (final class) implements MailboxMessage
|
||||
- PayoutTxFinalizedMessage (final class) implements MailboxMessage
|
||||
- PublishDepositTxRequest (final class)
|
||||
- DecryptedMsgWithPubKey (final class)
|
||||
- MailboxMessage (Interface)
|
||||
- PrefixedSealedAndSignedMessage (final class) implements SendersNodeAddressMessage
|
||||
- DisputeMessage (abstract class)
|
||||
- DisputeCommunicationMessage (final class)
|
||||
- DisputeResultMessage (final class)
|
||||
- OpenNewDisputeMessage (final class)
|
||||
- PeerOpenedDisputeMessage (final class)
|
||||
- PeerPublishedPayoutTxMessage (final class)
|
||||
- DepositTxPublishedMessage (final class) extends TradeMessage
|
||||
- FiatTransferStartedMessage (final class) extends TradeMessage
|
||||
- FinalizePayoutTxRequest (final class) extends TradeMessage
|
||||
- PayDepositRequest (final class) extends TradeMessage
|
||||
- PayoutTxFinalizedMessage (final class) extends TradeMessage
|
||||
- DataBroadcastMessage (abstract class)
|
||||
- AddDataMessage (final class)
|
||||
- RefreshTTLMessage (final class)
|
||||
- RemoveDataMessage (final class)
|
||||
- RemoveMailboxDataMessage (final class)
|
||||
- PeerExchangeMessage (abstract class)
|
||||
- GetPeersRequest (final class) implements SendersNodeAddressMessage
|
||||
- GetPeersResponse (final class)
|
||||
- KeepAliveMessage (abstract class)
|
||||
- Ping (final class)
|
||||
- Pong (final class)
|
||||
- GetDataResponse (final class)
|
||||
- CloseConnectionMessage (final class)
|
||||
*/
|
||||
private USPostalMoneyOrderAccount() {
|
||||
super(null /*PaymentMethod.US_POSTAL_MONEY_ORDER*/);
|
||||
}
|
||||
|
@ -31,11 +31,10 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class BuyerAsOffererTrade extends BuyerTrade implements OffererTrade, Serializable {
|
||||
public final class BuyerAsOffererTrade extends BuyerTrade implements OffererTrade {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -30,12 +30,11 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class BuyerAsTakerTrade extends BuyerTrade implements TakerTrade, Serializable {
|
||||
public final class BuyerAsTakerTrade extends BuyerTrade implements TakerTrade {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -29,9 +29,8 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class SellerAsOffererTrade extends SellerTrade implements OffererTrade, Serializable {
|
||||
public final class SellerAsOffererTrade extends SellerTrade implements OffererTrade {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -28,11 +28,10 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
|
||||
public class SellerAsTakerTrade extends SellerTrade implements TakerTrade, Serializable {
|
||||
public final class SellerAsTakerTrade extends SellerTrade implements TakerTrade {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -29,7 +29,7 @@ import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class TradableList<T extends Tradable> extends ArrayList<T> implements Persistable {
|
||||
public final class TradableList<T extends Tradable> extends ArrayList<T> implements Persistable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -56,7 +56,7 @@ import java.util.Date;
|
||||
* Holds all data which are relevant to the trade, but not those which are only needed in the trade process as shared data between tasks. Those data are
|
||||
* stored in the task model.
|
||||
*/
|
||||
abstract public class Trade implements Tradable, Model {
|
||||
public abstract class Trade implements Tradable, Model {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -26,10 +26,9 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
public class OpenOffer implements Tradable, Serializable {
|
||||
public final class OpenOffer implements Tradable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.util.List;
|
||||
|
||||
public class TradingPeer implements Persistable {
|
||||
public final class TradingPeer implements Persistable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -22,7 +22,7 @@ import io.bitsquare.common.persistance.Persistable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class BlockChainExplorer implements Persistable {
|
||||
public final class BlockChainExplorer implements Persistable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -42,7 +42,7 @@ import org.slf4j.LoggerFactory;
|
||||
import javax.inject.Inject;
|
||||
import java.util.*;
|
||||
|
||||
public class Preferences implements Persistable {
|
||||
public final class Preferences implements Persistable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -48,7 +48,7 @@ import java.util.stream.Collectors;
|
||||
* The User is persisted locally.
|
||||
* It must never be transmitted over the wire (messageKeyPair contains private key!).
|
||||
*/
|
||||
public class User implements Persistable {
|
||||
public final class User implements Persistable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
public class Navigation implements Persistable {
|
||||
public final class Navigation implements Persistable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
private static final Logger log = LoggerFactory.getLogger(Navigation.class);
|
||||
|
@ -25,7 +25,7 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class ViewPath extends ArrayList<Class<? extends View>> implements Persistable {
|
||||
public final class ViewPath extends ArrayList<Class<? extends View>> implements Persistable {
|
||||
// That object is saved to disc. We need to take care of changes to not break deserialization.
|
||||
private static final long serialVersionUID = Version.LOCAL_DB_VERSION;
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* This file is part of Bitsquare.
|
||||
*
|
||||
* Bitsquare is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Bitsquare is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Bitsquare. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package io.bitsquare.gui.main.offer.offerbook;
|
||||
|
||||
import io.bitsquare.locale.TradeCurrency;
|
||||
|
||||
public class AllTradeCurrenciesEntry extends TradeCurrency {
|
||||
public AllTradeCurrenciesEntry() {
|
||||
super(null, "All");
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@ import io.bitsquare.common.wire.Payload;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class NodeAddress implements Persistable, Payload {
|
||||
public final class NodeAddress implements Persistable, Payload {
|
||||
// That object is sent over the wire, so we need to take care of version compatibility.
|
||||
private static final long serialVersionUID = Version.P2P_NETWORK_VERSION;
|
||||
|
||||
|
@ -7,7 +7,7 @@ import io.bitsquare.p2p.NodeAddress;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class ReportedPeer implements Payload, Persistable {
|
||||
public final class ReportedPeer implements Payload, Persistable {
|
||||
// That object is sent over the wire, so we need to take care of version compatibility.
|
||||
private static final long serialVersionUID = Version.P2P_NETWORK_VERSION;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user