public static Identifier CreateIdentifier(string name, string uuid)
        {
            if (!UuidUtil.TryParse(uuid, out var uuid_r))
            {
                throw new ArgumentException("Invalid UUID format, could not parse");
            }
            var ret = new Identifier()
            {
                name = name,
                uuid = new UUID {
                    uuid_bytes = uuid_r
                }
            };

            return(ret);
        }
 public static string IdentifierToString(Identifier id)
 {
     if (id == null)
     {
         return(null);
     }
     if (!IsIdentifierAnyName(id) && !IsIdentifierAnyUuid(id))
     {
         return(id.name + "|" + UuidUtil.UuidToString(id.uuid));
     }
     if (!IsIdentifierAnyName(id))
     {
         return(id.name);
     }
     if (!IsIdentifierAnyUuid(id))
     {
         return(UuidUtil.UuidToString(id.uuid));
     }
     return(null);
 }