java.lang.Object
java.lang.Record
tech.deplant.java4ever.framework.ExplorerConfig
public record ExplorerConfig(String serializationPath, Map<String,ExplorerConfig.SavedContract> contracts, Map<String,Credentials> credentials)
extends Record
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionExplorerConfig
(String serializationPath, Map<String, ExplorerConfig.SavedContract> contracts, Map<String, Credentials> credentials) Creates an instance of aExplorerConfig
record class. -
Method Summary
Modifier and TypeMethodDescriptionaddContract
(String name, OwnedContract contract) Adds OwnedContract object to config with a given name as a key.addKeys
(String name, Credentials keys) Returns the value of thecontracts
record component.Returns the value of thecredentials
record component.static ExplorerConfig
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static ExplorerConfig
Returns the value of theserializationPath
record component.void
sync()
Flushes this config to file on serializationPath()final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ExplorerConfig
public ExplorerConfig(String serializationPath, Map<String, ExplorerConfig.SavedContract> contracts, Map<String, Credentials> credentials) Creates an instance of aExplorerConfig
record class.- Parameters:
serializationPath
- the value for theserializationPath
record componentcontracts
- the value for thecontracts
record componentcredentials
- the value for thecredentials
record component
-
-
Method Details
-
EMPTY
- Throws:
IOException
-
LOAD
public static ExplorerConfig LOAD(String configFilePath) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
keys
-
address
-
abi
public ContractAbi abi(String contractName) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
contract
public OwnedContract contract(Sdk sdk, String contractName, String keysName) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
addContract
Adds OwnedContract object to config with a given name as a key.- Parameters:
name
- key for finding contract in config latercontract
- contract object- Returns:
- OwnedContract that we successfully putted to config
- Throws:
IOException
- can be thrown by the call of sync() method
-
addKeys
- Throws:
IOException
-
sync
Flushes this config to file on serializationPath()- Throws:
IOException
- can be thrown by work with File
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
serializationPath
Returns the value of theserializationPath
record component.- Returns:
- the value of the
serializationPath
record component
-
contracts
Returns the value of thecontracts
record component.- Returns:
- the value of the
contracts
record component
-
credentials
Returns the value of thecredentials
record component.- Returns:
- the value of the
credentials
record component
-