コード例 #1
0
        /// <summary>
        /// Return a JSON representation of this object.
        /// </summary>
        /// <param name="CustomBootNotificationRequestSerializer">A delegate to serialize custom boot notification requests.</param>
        public JObject ToJSON(CustomJObjectSerializerDelegate <BootNotificationRequest> CustomBootNotificationRequestSerializer = null)
        {
            var JSON = JSONObject.Create(

                new JProperty("chargePointVendor", ChargePointVendor),
                new JProperty("chargePointModel", ChargePointModel),

                ChargePointSerialNumber.IsNotNullOrEmpty()
                               ? new JProperty("chargePointSerialNumber", ChargePointSerialNumber)
                               : null,

                ChargeBoxSerialNumber.IsNotNullOrEmpty()
                               ? new JProperty("chargeBoxSerialNumber", ChargeBoxSerialNumber)
                               : null,

                FirmwareVersion.IsNotNullOrEmpty()
                               ? new JProperty("firmwareVersion", FirmwareVersion)
                               : null,

                Iccid.IsNotNullOrEmpty()
                               ? new JProperty("iccid", Iccid)
                               : null,

                IMSI.IsNotNullOrEmpty()
                               ? new JProperty("imsi", IMSI)
                               : null,

                MeterType.IsNotNullOrEmpty()
                               ? new JProperty("meterType", MeterType)
                               : null,

                MeterSerialNumber.IsNotNullOrEmpty()
                               ? new JProperty("meterSerialNumber", MeterSerialNumber)
                               : null

                );

            return(CustomBootNotificationRequestSerializer != null
                       ? CustomBootNotificationRequestSerializer(this, JSON)
                       : JSON);
        }
コード例 #2
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(ChargePointVendor.GetHashCode() * 31 ^
                       ChargePointModel.GetHashCode() * 29 ^

                       (ChargePointSerialNumber != null
                            ? ChargePointSerialNumber.GetHashCode() * 21
                            : 0) ^

                       (ChargeBoxSerialNumber != null
                            ? ChargeBoxSerialNumber.GetHashCode() * 17
                            : 0) ^

                       (FirmwareVersion != null
                            ? FirmwareVersion.GetHashCode() * 13
                            : 0) ^

                       (Iccid != null
                            ? Iccid.GetHashCode() * 11
                            : 0) ^

                       (IMSI != null
                            ? IMSI.GetHashCode() * 7
                            : 0) ^

                       (MeterType != null
                            ? MeterType.GetHashCode() * 5
                            : 0) ^

                       (MeterSerialNumber != null
                            ? MeterSerialNumber.GetHashCode() * 3
                            : 0));
            }
        }
コード例 #3
0
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        public XElement ToXML()

        => new XElement(OCPPNS.OCPPv1_6_CS + "bootNotificationRequest",

                        new XElement(OCPPNS.OCPPv1_6_CS + "chargePointVendor", ChargePointVendor),
                        new XElement(OCPPNS.OCPPv1_6_CS + "chargePointModel", ChargePointModel),

                        ChargePointSerialNumber.IsNotNullOrEmpty()
                       ? new XElement(OCPPNS.OCPPv1_6_CS + "chargePointSerialNumber", ChargePointSerialNumber)
                       : null,

                        ChargeBoxSerialNumber.IsNotNullOrEmpty()
                       ? new XElement(OCPPNS.OCPPv1_6_CS + "chargeBoxSerialNumber", ChargeBoxSerialNumber)
                       : null,

                        ChargePointSerialNumber.IsNotNullOrEmpty()
                       ? new XElement(OCPPNS.OCPPv1_6_CS + "firmwareVersion", FirmwareVersion)
                       : null,

                        ChargeBoxSerialNumber.IsNotNullOrEmpty()
                       ? new XElement(OCPPNS.OCPPv1_6_CS + "iccid", Iccid)
                       : null,

                        ChargePointSerialNumber.IsNotNullOrEmpty()
                       ? new XElement(OCPPNS.OCPPv1_6_CS + "imsi", IMSI)
                       : null,

                        ChargeBoxSerialNumber.IsNotNullOrEmpty()
                       ? new XElement(OCPPNS.OCPPv1_6_CS + "meterType", MeterType)
                       : null,

                        ChargePointSerialNumber.IsNotNullOrEmpty()
                       ? new XElement(OCPPNS.OCPPv1_6_CS + "meterSerialNumber", MeterSerialNumber)
                       : null

                        );