Package com.usatiuk.dhfs.peersync

# Record Class PeerInfo

java.lang.Object
java.lang.Record
com.usatiuk.dhfs.peersync.PeerInfo

All Implemented Interfaces:
  `JDataRemote`, `JDataRemoteDto`, `Serializable`

public record PeerInfo(JObjectKey key, PeerId id, com.google.protobuf.ByteString cert, org.pcollections.PMap<PeerId,Long> kickCounter, long lastSeenTimestamp) extends Record implements JDataRemote, JDataRemoteDto

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`PeerInfo(PeerId id, byte[] cert)`
`PeerInfo(JObjectKey key, PeerId id, com.google.protobuf.ByteString cert, org.pcollections.PMap<PeerId,Long> kickCounter, long lastSeenTimestamp)`
Creates an instance of a `PeerInfo` record class.

## Method Summary

Modifier and Type
Method
Description
`com.google.protobuf.ByteString`
`cert()`
Returns the value of the `cert` record component.
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`final int`
`hashCode()`
Returns a hash code value for this object.
`PeerId`
`id()`
Returns the value of the `id` record component.
`JObjectKey`
`key()`
Returns the value of the `key` record component.
`org.pcollections.PMap<PeerId,Long>`
`kickCounter()`
Returns the value of the `kickCounter` record component.
`long`
`kickCounterSum()`
`long`
`lastSeenTimestamp()`
Returns the value of the `lastSeenTimestamp` record component.
`X509Certificate`
`parsedCert()`
`String`
`toString()`
Returns a string representation of this record class.
`PeerInfo`
`withIncrementedKickCounter(PeerId peerId)`
`PeerInfo`
`withKickCounter(org.pcollections.PMap<PeerId,Long> kickCounter)`
`PeerInfo`
`withLastSeenTimestamp(long lastSeenTimestamp)`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface com.usatiuk.dhfs.remoteobj.JDataRemote

`collectRefsTo, dtoClass, estimateSize`

### Methods inherited from interface com.usatiuk.dhfs.remoteobj.JDataRemoteDto

`objClass`

## Constructor Details

### PeerInfo

public PeerInfo(PeerId id, byte[] cert)

### PeerInfo

public PeerInfo(JObjectKey key, PeerId id, com.google.protobuf.ByteString cert, org.pcollections.PMap<PeerId,Long> kickCounter, long lastSeenTimestamp)
Creates an instance of a `PeerInfo` record class.

Parameters:
  `key` - the value for the `key` record component
  `id` - the value for the `id` record component
  `cert` - the value for the `cert` record component
  `kickCounter` - the value for the `kickCounter` record component
  `lastSeenTimestamp` - the value for the `lastSeenTimestamp` record component

## Method Details

### parsedCert

public X509Certificate parsedCert()

### withKickCounter

public PeerInfo withKickCounter(org.pcollections.PMap<PeerId,Long> kickCounter)

### withIncrementedKickCounter

public PeerInfo withIncrementedKickCounter(PeerId peerId)

### withLastSeenTimestamp

public PeerInfo withLastSeenTimestamp(long lastSeenTimestamp)

### kickCounterSum

public long kickCounterSum()

### toString

public String 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.

Specified by:
  `toString` in class `Record`
Returns:
  a string representation of this object

### 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.

Specified by:
  `hashCode` in class `Record`
Returns:
  a hash code value for this object

### equals

public final boolean equals(Object o)
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. Reference components are compared with `Objects::equals(Object,Object)`; primitive components are compared with '=='.

Specified by:
  `equals` in class `Record`
Parameters:
  `o` - the object with which to compare
Returns:
  `true` if this object is the same as the `o` argument; `false` otherwise.

### key

public JObjectKey key()
Returns the value of the `key` record component.

Specified by:
  `key` in interface `JDataRemote`
Returns:
  the value of the `key` record component

### id

public PeerId id()
Returns the value of the `id` record component.

Returns:
  the value of the `id` record component

### cert

public com.google.protobuf.ByteString cert()
Returns the value of the `cert` record component.

Returns:
  the value of the `cert` record component

### kickCounter

public org.pcollections.PMap<PeerId,Long> kickCounter()
Returns the value of the `kickCounter` record component.

Returns:
  the value of the `kickCounter` record component

### lastSeenTimestamp

public long lastSeenTimestamp()
Returns the value of the `lastSeenTimestamp` record component.

Returns:
  the value of the `lastSeenTimestamp` record component