Class StorageRecord
- Namespace
- RetailForce.Fiscalisation.Storage
- Assembly
- RetailForce.Fiscalisation.Model.dll
Storage record for storage streams.
public abstract class StorageRecord : IEquatable<StorageRecord>
- Inheritance
-
StorageRecord
- Implements
- Derived
- Inherited Members
Remarks
Storage format: [{base64-algorithm}.]{base64-data}[.{base64-signature}]
Properties
Data
The plain data in utf8 encoding.
[JsonIgnore]
public string Data { get; protected set; }
Property Value
Remarks
The data will be base64- or base64-url-encoded (depending on DataStorage<TData>.UrlEncode).
RecordDateTime
The datetime for this storage record.
public DateTime RecordDateTime { get; set; }
Property Value
Signature
The signature for the data (base64 encoded or base64 url encoded (DataStorage<TData>.UrlEncode).
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string Signature { get; set; }
Property Value
Methods
Algorithm()
Returns a possible algorithm for the storage record. Empty string can be returned.
public virtual string Algorithm()
Returns
- string
A possible algorithm for the storage record. Empty string can be returned.
Equals(StorageRecord)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(StorageRecord other)
Parameters
otherStorageRecordAn object to compare with this object.
Returns
GetData()
Method to get data property. Override in inherited class to get data in string notation.
protected abstract string GetData()
Returns
ResolveDataStorageRecord<TData>(string, bool, bool, bool)
Resolves a storage record stored in format yyyymmddhhmmssnnn.algorithm.data.signature
public static TData ResolveDataStorageRecord<TData>(string data, bool algorithmMandatory, bool signatureMandatory, bool urlEncode) where TData : StorageRecord, new()
Parameters
datastringThe data to
algorithmMandatoryboolTrue if the algorithm must exist.
signatureMandatoryboolTrue if the signature must exist.
urlEncodeboolTrue if the data is url-encoded.
Returns
- TData
The StorageRecord of type
TData.
Type Parameters
TDataThe type which should be returned.
SetData(string)
Method to set data property. Override in inherited class to parse data if necessary.
protected abstract void SetData(string data)
Parameters
datastringThe data to set.
Exceptions
- ArgumentNullException
Thrown if parameter
datais set to null or Empty.