Show / Hide Table of Contents

# Class IdGenerator

##### Inheritance

System.Object
IdGenerator

##### Inherited Members

System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()

###### Namespace: Apache.NMS.ActiveMQ.Util

###### Assembly: Apache.NMS.ActiveMQ.dll

##### Syntax

    public class IdGenerator

### Constructors

| Improve this Doc View Source

#### IdGenerator()

##### Declaration

    public IdGenerator()

| Improve this Doc View Source

#### IdGenerator(String)

##### Declaration

    public IdGenerator(string prefix)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | prefix |

### Properties

| Improve this Doc View Source

#### HostName

As we have to find the hostname as a side-affect of generating a unique stub, we allow it's easy retrevial here

##### Declaration

    public static string HostName { get; }

##### Property Value

Type | Description
--- | ---
System.String |

### Methods

| Improve this Doc View Source

#### Compare(String, String)

Does a proper compare on the ids

##### Declaration

    public static int Compare(string id1, string id2)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | id1 | A System.String
System.String | id2 | A System.String

##### Returns

Type | Description
--- | ---
System.Int32 | A System.Int32

| Improve this Doc View Source

#### GenerateId()

Generate a Unique Id

##### Declaration

    public string GenerateId()

##### Returns

Type | Description
--- | ---
System.String | A System.String

| Improve this Doc View Source

#### GenerateSanitizedId()

Generate a unique ID - that is friendly for a URL or file system

##### Declaration

    public string GenerateSanitizedId()

##### Returns

Type | Description
--- | ---
System.String | A System.String

| Improve this Doc View Source

#### GetSeedFromId(String)

From a generated id - return the seed (i.e. minus the count)

##### Declaration

    public static string GetSeedFromId(string id)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | id | A System.String

##### Returns

Type | Description
--- | ---
System.String | A System.String

| Improve this Doc View Source

#### GetSequenceFromId(String)

From a generated id - return the generator count

##### Declaration

    public static long GetSequenceFromId(string id)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | id | A System.String

##### Returns

Type | Description
--- | ---
System.Int64 | A System.Int64