Class LiteralExtensions
Provides extension methods for converting primitive types into appropriately typed Literal Nodes.
Inheritance
System.Object
LiteralExtensions
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()
Assembly: dotNetRDF.dll
Syntax
public static class LiteralExtensions
Methods
|
Improve this Doc
View Source
ToLiteral(Boolean, INodeFactory)
Creates a new Boolean typed literal.
Declaration
public static ILiteralNode ToLiteral(this bool b, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.Boolean |
b |
Boolean. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the boolean. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteral(Byte, INodeFactory)
Creates a new Byte typed literal.
Declaration
public static ILiteralNode ToLiteral(this byte b, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.Byte |
b |
Byte. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the byte. |
|
Improve this Doc
View Source
ToLiteral(DateTime, INodeFactory)
Creates a new Date Time typed literal.
Declaration
public static ILiteralNode ToLiteral(this DateTime dt, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.DateTime |
dt |
Date Time. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the date time. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteral(DateTime, INodeFactory, Boolean)
Creates a new Date Time typed literal.
Declaration
public static ILiteralNode ToLiteral(this DateTime dt, INodeFactory factory, bool precise)
Parameters
Type |
Name |
Description |
System.DateTime |
dt |
Date Time. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
System.Boolean |
precise |
Whether to preserve precisely i.e. include fractional seconds. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the date time. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteral(DateTimeOffset, INodeFactory)
Creates a new Date Time typed literal.
Declaration
public static ILiteralNode ToLiteral(this DateTimeOffset dt, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.DateTimeOffset |
dt |
Date Time. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the date time. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteral(DateTimeOffset, INodeFactory, Boolean)
Creates a new Date Time typed literal.
Declaration
public static ILiteralNode ToLiteral(this DateTimeOffset dt, INodeFactory factory, bool precise)
Parameters
Type |
Name |
Description |
System.DateTimeOffset |
dt |
Date Time. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
System.Boolean |
precise |
Whether to preserve precisely i.e. include fractional seconds. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the date time. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteral(Decimal, INodeFactory)
Creates a new Decimal typed literal.
Declaration
public static ILiteralNode ToLiteral(this decimal d, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.Decimal |
d |
Decimal. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the decimal. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteral(Double, INodeFactory)
Creates a new Double typed literal.
Declaration
public static ILiteralNode ToLiteral(this double d, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.Double |
d |
Double. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the double. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteral(Int16, INodeFactory)
Creates a new Integer typed literal.
Declaration
public static ILiteralNode ToLiteral(this short i, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.Int16 |
i |
Integer. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the short. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteral(Int32, INodeFactory)
Creates a new Integer typed literal.
Declaration
public static ILiteralNode ToLiteral(this int i, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.Int32 |
i |
Integer. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the integer. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteral(Int64, INodeFactory)
Creates a new Integer typed literal.
Declaration
public static ILiteralNode ToLiteral(this long l, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.Int64 |
l |
Integer. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the integer. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteral(SByte, INodeFactory)
Creates a new Byte typed literal.
Declaration
public static ILiteralNode ToLiteral(this sbyte b, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.SByte |
b |
Byte. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the signed bytes. |
|
Improve this Doc
View Source
ToLiteral(Single, INodeFactory)
Creates a new Float typed literal.
Declaration
public static ILiteralNode ToLiteral(this float f, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.Single |
f |
Float. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the float. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteral(String, INodeFactory)
Creates a new String typed literal.
Declaration
public static ILiteralNode ToLiteral(this string s, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.String |
s |
String. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the string. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Graph/String argument is null. |
|
Improve this Doc
View Source
ToLiteral(TimeSpan, INodeFactory)
Creates a new duration typed literal.
Declaration
public static ILiteralNode ToLiteral(this TimeSpan t, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.TimeSpan |
t |
Time Span. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the time span. |
|
Improve this Doc
View Source
ToLiteralDate(DateTime, INodeFactory)
Creates a new Date typed literal.
Declaration
public static ILiteralNode ToLiteralDate(this DateTime dt, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.DateTime |
dt |
Date Time. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteralDate(DateTimeOffset, INodeFactory)
Creates a new Date typed literal.
Declaration
public static ILiteralNode ToLiteralDate(this DateTimeOffset dt, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.DateTimeOffset |
dt |
Date Time. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteralTime(DateTime, INodeFactory)
Creates a new Time typed literal.
Declaration
public static ILiteralNode ToLiteralTime(this DateTime dt, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.DateTime |
dt |
Date Time. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the time. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteralTime(DateTime, INodeFactory, Boolean)
Creates a new Time typed literal.
Declaration
public static ILiteralNode ToLiteralTime(this DateTime dt, INodeFactory factory, bool precise)
Parameters
Type |
Name |
Description |
System.DateTime |
dt |
Date Time. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
System.Boolean |
precise |
Whether to preserve precisely i.e. include fractional seconds. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the time. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteralTime(DateTimeOffset, INodeFactory)
Creates a new Time typed literal.
Declaration
public static ILiteralNode ToLiteralTime(this DateTimeOffset dt, INodeFactory factory)
Parameters
Type |
Name |
Description |
System.DateTimeOffset |
dt |
Date Time. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the time. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |
|
Improve this Doc
View Source
ToLiteralTime(DateTimeOffset, INodeFactory, Boolean)
Creates a new Time typed literal.
Declaration
public static ILiteralNode ToLiteralTime(this DateTimeOffset dt, INodeFactory factory, bool precise)
Parameters
Type |
Name |
Description |
System.DateTimeOffset |
dt |
Date Time. |
INodeFactory |
factory |
Node Factory to use for Node creation. |
System.Boolean |
precise |
Whether to preserve precisely i.e. include fractional seconds. |
Returns
Type |
Description |
ILiteralNode |
Literal representing the time. |
Exceptions
Type |
Condition |
System.ArgumentNullException |
Thrown if the Factory argument is null. |