Repository navigation
io microsphere misc UnsafeUtils
Type: Class | Module: microsphere-java-core | Package: io.microsphere.misc | Since: 1.0.0
Source:
microsphere-java-core/src/main/java/io/microsphere/misc/UnsafeUtils.java
sun.misc.Unsafe Utility class
Take case to use those utility methods in order to the stability fo JVM
public abstract class UnsafeUtils implements UtilsAuthor: Mercy
-
Introduced in:
1.0.0 -
Current Project Version:
0.3.20-SNAPSHOT
This component is tested and compatible with the following Java versions:
| Java Version | Status |
|---|---|
| Java 8 | ✅ Compatible |
| Java 11 | ✅ Compatible |
| Java 17 | ✅ Compatible |
| Java 21 | ✅ Compatible |
| Java 25 | ✅ Compatible |
Add the following dependency to your pom.xml:
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-java-core</artifactId>
<version>${microsphere-java.version}</version>
</dependency>Tip: Use the BOM (
microsphere-java-dependencies) for consistent version management. See the Getting Started guide.
import io.microsphere.misc.UnsafeUtils;| Method | Description |
|---|---|
getLongVolatileFromArray |
|
getIntVolatileFromArray |
Get the value of the target Index in the object Array field |
getShortVolatileFromArray |
Get the short value of the target Index in the Array field of the object |
getByteVolatileFromArray |
Get the byte value of the target Index in the object Array field |
getBooleanVolatileFromArray |
Get the boolean value of the target Index in the Array field of the object |
getDoubleVolatileFromArray |
Get the double value of the target Index in the Array field of the object |
getFloatVolatileFromArray |
Get the float value of the target Index in the object Array field |
getCharVolatileFromArray |
Get the char value of the target Index in the object Array field |
getObjectVolatileFromArray |
Get the java.lang.Object value of the target Index in the object Array field |
putDouble |
Sets the given double value to the field of the specified object |
putFloat |
Sets the given float value to the field of the specified object |
putShort |
Sets the given short value to the field of the specified object |
putByte |
Sets the given byte value to the field of the specified object |
putBoolean |
Sets the given boolean value to the field of the specified object |
putChar |
Sets the given char value to the field of the specified object |
putObject |
Sets the given Object value to the field of the specified object |
putLong |
Sets the given long value to the field of the specified object |
putInt |
Sets the given int value to the field of the specified object |
putOrderedInt |
Sets the given int value to the field of the specified object (ensures writing order) |
putOrderedLong |
Sets the given long value to the field of the specified object (ensures writing order) |
public static int getIntVolatileFromArray(@Nonnull Object object, @Nonnull String fieldName, int index)Get the value of the target Index in the object Array field
public static short getShortVolatileFromArray(@Nonnull Object object, @Nonnull String fieldName, int index)Get the short value of the target Index in the Array field of the object
public static byte getByteVolatileFromArray(@Nonnull Object object, @Nonnull String fieldName, int index)Get the byte value of the target Index in the object Array field
public static boolean getBooleanVolatileFromArray(@Nonnull Object object, @Nonnull String fieldName, int index)Get the boolean value of the target Index in the Array field of the object
public static double getDoubleVolatileFromArray(@Nonnull Object object, @Nonnull String fieldName, int index)Get the double value of the target Index in the Array field of the object
public static float getFloatVolatileFromArray(@Nonnull Object object, @Nonnull String fieldName, int index)Get the float value of the target Index in the object Array field
public static char getCharVolatileFromArray(@Nonnull Object object, @Nonnull String fieldName, int index)Get the char value of the target Index in the object Array field
public static Object getObjectVolatileFromArray(@Nonnull Object object, @Nonnull String fieldName, int index)Get the java.lang.Object value of the target Index in the object Array field
public static void putDouble(@Nonnull Object object, @Nonnull String fieldName, double value)Sets the given double value to the field of the specified object
public static void putFloat(@Nonnull Object object, @Nonnull String fieldName, float value)Sets the given float value to the field of the specified object
public static void putShort(@Nonnull Object object, @Nonnull String fieldName, short value)Sets the given short value to the field of the specified object
public static void putByte(@Nonnull Object object, @Nonnull String fieldName, byte value)Sets the given byte value to the field of the specified object
public static void putBoolean(@Nonnull Object object, @Nonnull String fieldName, boolean value)Sets the given boolean value to the field of the specified object
public static void putChar(@Nonnull Object object, @Nonnull String fieldName, char value)Sets the given char value to the field of the specified object
public static void putObject(@Nonnull Object object, @Nonnull String fieldName, @Nullable Object value)Sets the given Object value to the field of the specified object
public static void putLong(@Nonnull Object object, @Nonnull String fieldName, long value)Sets the given long value to the field of the specified object
public static void putInt(@Nonnull Object object, @Nonnull String fieldName, int value)Sets the given int value to the field of the specified object
public static void putOrderedInt(@Nonnull Object object, @Nonnull String fieldName, int value)Sets the given int value to the field of the specified object (ensures writing order)
public static void putOrderedLong(@Nonnull Object object, @Nonnull String fieldName, long value)Sets the given long value to the field of the specified object (ensures writing order)
sun.misc.Unsafe
This documentation was auto-generated from the source code of microsphere-java.
annotation-processor
- ConfigurationPropertyAnnotationProcessor
- ConfigurationPropertyJSONElementVisitor
- FilerProcessor
- ResourceProcessor
annotation-test
java-annotations
java-core
- ACLLoggerFactory
- AbstractArtifactResourceResolver
- AbstractConverter
- AbstractDeque
- AbstractEventDispatcher
- AbstractLogger
- AbstractSerializer
- AbstractURLClassPathHandle
- AccessibleObjectUtils
- AdditionalMetadataResourceConfigurationPropertyLoader
- AnnotationUtils
- ArchiveFileArtifactResourceResolver
- ArrayEnumeration
- ArrayStack
- ArrayUtils
- Artifact
- ArtifactDetector
- ArtifactResourceResolver
- Assert
- BannedArtifactClassLoadingExecutor
- BeanMetadata
- BeanProperty
- BeanUtils
- BooleanSerializer
- ByteArrayToObjectConverter
- ByteSerializer
- CharSequenceComparator
- CharSequenceUtils
- CharacterSerializer
- CharsetUtils
- ClassDataRepository
- ClassDefinition
- ClassFileJarEntryFilter
- ClassFilter
- ClassLoaderUtils
- ClassPathResourceConfigurationPropertyLoader
- ClassPathUtils
- ClassUtils
- ClassicProcessIdResolver
- ClassicURLClassPathHandle
- CollectionUtils
- Compatible
- CompositeSubProtocolURLConnectionFactory
- CompositeURLStreamHandlerFactory
- ConditionalEventListener
- ConfigurationProperty
- ConfigurationPropertyGenerator
- ConfigurationPropertyLoader
- ConfigurationPropertyReader
- Configurer
- ConsoleURLConnection
- ConstantPoolUtils
- Constants
- ConstructorDefinition
- ConstructorUtils
- Converter
- Converters
- CustomizedThreadFactory
- DefaultConfigurationPropertyGenerator
- DefaultConfigurationPropertyReader
- DefaultDeserializer
- DefaultEntry
- DefaultSerializer
- DelegatingBlockingQueue
- DelegatingDeque
- DelegatingIterator
- DelegatingQueue
- DelegatingScheduledExecutorService
- DelegatingURLConnection
- DelegatingURLStreamHandlerFactory
- DelegatingWrapper
- Deprecation
- Deserializer
- Deserializers
- DirectEventDispatcher
- DirectoryFileFilter
- DoubleSerializer
- EmptyDeque
- EmptyIterable
- EmptyIterator
- EnumSerializer
- EnumerationIteratorAdapter
- EnumerationUtils
- Event
- EventDispatcher
- EventListener
- ExceptionUtils
- ExecutableDefinition
- ExecutableUtils
- ExecutorUtils
- ExtendableProtocolURLStreamHandler
- FastByteArrayInputStream
- FastByteArrayOutputStream
- FieldDefinition
- FieldUtils
- FileChangedEvent
- FileChangedListener
- FileConstants
- FileExtensionFilter
- FileUtils
- FileWatchService
- Files
- Filter
- FilterOperator
- FilterUtils
- FloatSerializer
- FormatUtils
- Functional
- GenericEvent
- GenericEventListener
- Handler
- Handler
- HierarchicalClassComparator
- IOFileFilter
- IOUtils
- ImmutableEntry
- IntegerSerializer
- IterableAdapter
- IterableUtils
- Iterators
- JDKLoggerFactory
- JSON
- JSONArray
- JSONException
- JSONObject
- JSONStringer
- JSONTokener
- JSONUtils
- JarEntryFilter
- JarUtils
- JavaType
- JmxUtils
- LambdaUtils
- ListUtils
- Listenable
- Lists
- Logger
- LoggerFactory
- LoggerUtils
- LoggingFileChangedListener
- LongSerializer
- MBeanAttribute
- MBeanAttributeInfoBuilder
- MBeanConstructorInfoBuilder
- MBeanDescribableBuilder
- MBeanExecutableInfoBuilder
- MBeanFeatureInfoBuilder
- MBeanInfoBuilder
- MBeanNotificationInfoBuilder
- MBeanOperationInfoBuilder
- MBeanParameterInfoBuilder
- ManagementUtils
- ManifestArtifactResourceResolver
- MapToPropertiesConverter
- MapUtils
- Maps
- MavenArtifact
- MavenArtifactResourceResolver
- MemberDefinition
- MemberUtils
- MetadataResourceConfigurationPropertyLoader
- MethodDefinition
- MethodHandleUtils
- MethodHandlesLookupUtils
- MethodUtils
- ModernProcessIdResolver
- ModernURLClassPathHandle
- Modifier
- MultiValueConverter
- MultipleType
- MutableInteger
- MutableURLStreamHandlerFactory
- NameFileFilter
- NoOpLogger
- NoOpLoggerFactory
- NoOpURLClassPathHandle
- NumberToByteConverter
- NumberToCharacterConverter
- NumberToDoubleConverter
- NumberToFloatConverter
- NumberToIntegerConverter
- NumberToLongConverter
- NumberToShortConverter
- NumberUtils
- ObjectToBooleanConverter
- ObjectToByteArrayConverter
- ObjectToByteConverter
- ObjectToCharacterConverter
- ObjectToDoubleConverter
- ObjectToFloatConverter
- ObjectToIntegerConverter
- ObjectToLongConverter
- ObjectToOptionalConverter
- ObjectToShortConverter
- ObjectToStringConverter
- ObjectUtils
- PackageNameClassFilter
- PackageNameClassNameFilter
- ParallelEventDispatcher
- ParameterizedTypeImpl
- PathConstants
- Predicates
- Prioritized
- PriorityComparator
- ProcessExecutor
- ProcessIdResolver
- ProcessManager
- PropertiesToStringConverter
- PropertiesUtils
- PropertyConstants
- PropertyResourceBundleControl
- PropertyResourceBundleUtils
- ProtocolConstants
- ProxyUtils
- QueueUtils
- ReadOnlyIterator
- ReflectionUtils
- ReflectiveConfigurationPropertyGenerator
- ReflectiveDefinition
- ResourceConstants
- ReversedDeque
- Scanner
- SecurityUtils
- SeparatorConstants
- Serializer
- Serializers
- ServiceLoaderURLStreamHandlerFactory
- ServiceLoaderUtils
- ServiceLoadingURLClassPathHandle
- SetUtils
- Sets
- Sfl4jLoggerFactory
- ShortSerializer
- ShutdownHookCallbacksThread
- ShutdownHookUtils
- SimpleClassScanner
- SimpleFileScanner
- SimpleJarEntryScanner
- SingletonDeque
- SingletonEnumeration
- SingletonIterator
- SizeUtils
- StackTraceUtils
- StandardFileWatchService
- StandardURLStreamHandlerFactory
- StopWatch
- StreamArtifactResourceResolver
- Streams
- StringBuilderWriter
- StringConverter
- StringDeserializer
- StringSerializer
- StringToArrayConverter
- StringToBlockingDequeConverter
- StringToBlockingQueueConverter
- StringToBooleanConverter
- StringToByteConverter
- StringToCharArrayConverter
- StringToCharacterConverter
- StringToClassConverter
- StringToCollectionConverter
- StringToDequeConverter
- StringToDoubleConverter
- StringToDurationConverter
- StringToFloatConverter
- StringToInputStreamConverter
- StringToIntegerConverter
- StringToIterableConverter
- StringToListConverter
- StringToLongConverter
- StringToMultiValueConverter
- StringToNavigableSetConverter
- StringToQueueConverter
- StringToSetConverter
- StringToShortConverter
- StringToSortedSetConverter
- StringToStringConverter
- StringToTransferQueueConverter
- StringUtils
- SubProtocolURLConnectionFactory
- SymbolConstants
- SystemUtils
- ThrowableAction
- ThrowableBiConsumer
- ThrowableBiFunction
- ThrowableConsumer
- ThrowableFunction
- ThrowableSupplier
- ThrowableUtils
- TrueClassFilter
- TrueFileFilter
- TypeArgument
- TypeFinder
- TypeUtils
- URLClassPathHandle
- URLUtils
- UnmodifiableDeque
- UnmodifiableIterator
- UnmodifiableQueue
- UnsafeUtils
- Utils
- ValueHolder
- Version
- VersionUtils
- VirtualMachineProcessIdResolver
- Wrapper
- WrapperProcessor
java-test
- Ancestor
- ArrayTypeModel
- CollectionTypeModel
- Color
- ConfigurationPropertyModel
- DefaultTestService
- GenericTestService
- MapTypeModel
- Model
- Parent
- PrimitiveTypeModel
- SimpleTypeModel
- StringArrayList
- TestAnnotation
- TestService
- TestServiceImpl
jdk-tools
lang-model