public static CheckedContainerIdentification Parse(RawCheckedContainerIdentification rawContainerIdentification) { Utilities.Parse(rawContainerIdentification.Value, out var ownerCodeValue, out var equipmentCategoryString, out var serialNumberValue, out var checkDigitStringValue); var containerIdentification = CheckedContainerIdentification.NewFrom(ownerCodeValue, equipmentCategoryString, serialNumberValue, checkDigitStringValue); return(containerIdentification); }
public static CheckedContainerIdentification NewFrom(string ownerCodeValue, string equipmentCategoryString, string serialNumberValue, string checkDigitStringValue) { var ownerCode = ownerCodeValue.AsOwnerCode(); var equipmentCategory = Utilities.GetEquipmentCategory(equipmentCategoryString); // Assumes standard string. var serialNumber = serialNumberValue.AsSerialNumber(); var checkDigit = checkDigitStringValue.AsCheckDigit(); var containerIdentification = CheckedContainerIdentification.NewFrom(ownerCode, equipmentCategory, serialNumber, checkDigit); return(containerIdentification); }
public static CheckedContainerIdentification NewFromUnvalidated(string unvalidatedOwnerCodeValue, string unvalidatedEquipmentCategoryValue, string unvalidatedSerialNumberValue, string unvalidatedCheckDigitStringValue) { var ownerCode = unvalidatedOwnerCodeValue.ToOwnerCode(); var equipmentCategory = unvalidatedEquipmentCategoryValue.ToEquipmentCategory(); var serialNumber = unvalidatedSerialNumberValue.ToSerialNumber(); var checkDigit = unvalidatedCheckDigitStringValue.ToCheckDigit(); var checkedContainerIdentification = CheckedContainerIdentification.NewFrom(ownerCode, equipmentCategory, serialNumber, checkDigit); return(checkedContainerIdentification); }